From patchwork Wed Oct 19 08:22:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4533 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp203763wrs; Wed, 19 Oct 2022 01:43:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7B33xW6dl3mDwGrCgNl/ZMyl7Bo1gnywtV97OHZ6SSgug7ZoFTC0b8Sp7Nh63d0d0MdFrB X-Received: by 2002:a05:6a00:1306:b0:555:6d3f:11ed with SMTP id j6-20020a056a00130600b005556d3f11edmr7516739pfu.55.1666169039607; Wed, 19 Oct 2022 01:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666169039; cv=none; d=google.com; s=arc-20160816; b=c+3D4riKLcOU5y8cSMfM3W6XJCoZW91OYSHolqy0e3c9HllU1MUEKqmYFpqcJbXnWs EaOFpOkTtb21kjH2Dy5HzBeif8GpjfJhQgVYkpblbuGhLOzp2u35RkloueHMfdKvaaqO mN3DfK854s+nkP1Kv2xDrbvqMUw4riQ7WpJ0rmesqcdzDEWFmk6zYcp5BX4xSs7m0qn0 jumRrXcyr4tHZAiAdyuib+N8FsnM0m53NUfF8KU0DaaiB8m+I/CXHQTkXIeJCPrCVqJL kqWHps4+K1qoVBPgGPpy3NUlr6Q+oECbDkGx+3hmH6LDjfi5Y0mMmFVYplxTBlAgI9qg NICA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=87J+Xbu2NgOxZkDmfpWuEUrSqNr9zdrQB2kaqDUuIJE=; b=xW1tfcyspOT+O/Urr6628MFr5WWF3sN86c48UTjrdVYNHhDXGGQdkUz7GH3gfvasyn WmSNe0zmYoteFYtd5BbA/61GWI49r6syZaXgioZOWZRg4aQAvRiqPrEU6TFFvtW8FM38 9dujzllcI9pIgQJ/QXgj7t9O5vl6sJ4xSHAHhkGZLydGV4t/RHGlhKSTwQz/QkOvADrJ 2QTwTUW47QtBaepbaoP485efwCNjksg8rY1K32IGt5ngsZznWcqYbBo+Bh06BUcrxv7U 4OxyQNswZRFKhJ93C9mHgV4HvfuyJgGELVPYABm+0/xiW7JZEz3v1Ax81APUY9TxNi3N kdmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vdc6q2bO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d1-20020a17090a8d8100b001fde53d5d79si23331314pjo.5.2022.10.19.01.43.47; Wed, 19 Oct 2022 01:43:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vdc6q2bO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231274AbiJSInV (ORCPT + 99 others); Wed, 19 Oct 2022 04:43:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231189AbiJSImW (ORCPT ); Wed, 19 Oct 2022 04:42:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD8F042AD9; Wed, 19 Oct 2022 01:39:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 757E7B82234; Wed, 19 Oct 2022 08:39:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD57BC433C1; Wed, 19 Oct 2022 08:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666168784; bh=p5/X/8K03kH+hgzQsYC4VASRtCEOfafEweUf2IKRMd4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vdc6q2bO5agx1VQa4q/2GrYsfBcNvkOEac1nQGJt214SW2j/GwUY715+dGDTeAsej UNV/3LUODO9kdRqjquYKxdm7JgvzjjhZik1g9sJgcGsNSqo/tLyAYAhyj8qj6C+1Wl a67dE1DW7k6cOT9lspRNwfDWmiLeLuQa44eTog00= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Mengda Chen , Guenter Roeck Subject: [PATCH 6.0 052/862] hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API Date: Wed, 19 Oct 2022 10:22:19 +0200 Message-Id: <20221019083252.285526333@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747104867144208004?= X-GMAIL-MSGID: =?utf-8?q?1747104867144208004?= From: Liang He commit 7f62cf781e6567d59c8935dc8c6068ce2bb904b7 upstream. In gsc_hwmon_get_devtree_pdata(), we should call of_node_get() before the of_find_compatible_node() which will automatically call of_node_put() for the 'from' argument. Fixes: 3bce5377ef66 ("hwmon: Add Gateworks System Controller support") Signed-off-by: Liang He Co-developed-by: Mengda Chen Signed-off-by: Mengda Chen Link: https://lore.kernel.org/r/20220916154708.3084515-1-chenmengda2009@163.com Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/gsc-hwmon.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/hwmon/gsc-hwmon.c +++ b/drivers/hwmon/gsc-hwmon.c @@ -267,6 +267,7 @@ gsc_hwmon_get_devtree_pdata(struct devic pdata->nchannels = nchannels; /* fan controller base address */ + of_node_get(dev->parent->of_node); fan = of_find_compatible_node(dev->parent->of_node, NULL, "gw,gsc-fan"); if (fan && of_property_read_u32(fan, "reg", &pdata->fan_base)) { of_node_put(fan);