From patchwork Mon Oct 24 11:27:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9698 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp544316wru; Mon, 24 Oct 2022 09:31:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6cjFJ5q/47N+fsj7WATNKlG5lkYul0gkGnckUXOCj5KGgm7uK1LP4ehvB7dpzG8tDIjTWb X-Received: by 2002:a05:6402:3217:b0:461:d6d7:7f19 with SMTP id g23-20020a056402321700b00461d6d77f19mr4095897eda.109.1666629107543; Mon, 24 Oct 2022 09:31:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666629107; cv=none; d=google.com; s=arc-20160816; b=XsWAlcvvd5m7bImdPjWh2YI3wu7oL4EbwL0CfZNLwlsoov72Y5RHf7l+77QsVv2GTP Uk1J4ZG423Szt5PcAvIeqE2TXmexUazmHT3vGU88Vhb3gFp9ccRoKBU7V40ojqWbi8nS LYaOPaFLmtdvTZ4ICkwm9Zq4JwdZuCqYOU6c/q6xuSpbZ1i5PCr6wpYS4EfehrQHPK32 jX2JESkt5xq3dhXo1qVW6+k72RiIVbDFrTeXNI+r/h8XkrtXTmawWsE+XAl2D0JBOzB1 MvX+/mnuyTpUWxNiZ7roVYIWmH+eU75ECZvZFLcGknIwGMk8t3gocqu2+MRh4Y9rGgvO WfTw== 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=kAy4NrkKR2QiHW/iYdPqZ67JivxqMxR6zRtn6zBBxY0=; b=YG9ISuWfwOrhpr0T2+U+zFAA6KlxcptmtNLMLtvZ+de2iULIXPW1yvlE/is3OE/dFi IWn0eWVqid16ei09lLHXu4PQA5ZGescpzzWVQo7LftPtM8j84FDICBkxK3YYidqjKHjT jEPFtRWYjrR/kDupILSUkzk7H4jY5PXGR6WR42kkExZUT9QiY+dnWb7mx5xaVvDeJFdD kMkYFMDDzF7Wk8V52x/CoB8mItKACAuKZoWEaLmLOOlkWvbyMu7t4gP8VGfG2famGhhx Ic8u1KU6XE38Wb4spbSM8RW+rrrRhSxHFi845Td118AOhGHwJhNUgC2fN4cP9gFzcGfs 87Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pw2sbVyD; 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 eb9-20020a0564020d0900b0046154884604si233502edb.482.2022.10.24.09.31.23; Mon, 24 Oct 2022 09:31:47 -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=pw2sbVyD; 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 S234091AbiJXQRF (ORCPT + 99 others); Mon, 24 Oct 2022 12:17:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234809AbiJXQPN (ORCPT ); Mon, 24 Oct 2022 12:15:13 -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 EA8B7459AA; Mon, 24 Oct 2022 08:03:06 -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 4B8C4B81597; Mon, 24 Oct 2022 12:17:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A12A1C433B5; Mon, 24 Oct 2022 12:17:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613829; bh=pz2UwXMRKNrNA4L+NtDLBqs3w52XvYBv/P4Jt38nelM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pw2sbVyDktc00PH/ZqggElW8sSdFG0Pe6Ecj8hdM7FRLRTran1NWYy8BJl28mohXP srQsXG12GZyn1PUUjkTeDNLjHtOPeUcZ2O6qRuceVqj8oSk6ExD6LWD4mvEQtVz+zR pKXwEBWEgKTS1PL0Z7o5S3BvZTvhjdVS+ho8nf/c= 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 5.10 030/390] hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API Date: Mon, 24 Oct 2022 13:27:07 +0200 Message-Id: <20221024113023.875915601@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747587282953262758?= X-GMAIL-MSGID: =?utf-8?q?1747587282953262758?= 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)) { dev_err(dev, "fan node without base\n");