From patchwork Sat Oct 22 07:18:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7167 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1088374wrr; Sat, 22 Oct 2022 00:39:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6otrArXo38zxleVY2LhNAx/SgcL0CF/0AAIjBCoEPju4TPLmQCLXXUjpBWQ1t3UOtpkdKU X-Received: by 2002:a65:6e0f:0:b0:43a:1cd4:4ae6 with SMTP id bd15-20020a656e0f000000b0043a1cd44ae6mr19097098pgb.289.1666424389758; Sat, 22 Oct 2022 00:39:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666424389; cv=none; d=google.com; s=arc-20160816; b=ksmgkvYxdCiqbpf6BtG5tmoNQPVt4ArWWbnc8CgcU/S68yKEaz6zliOXxFOGgbi11+ HsHwt3FrdFQ0OuRAxf2Ma7bbSiPKJZgehdfXZb0an+wOJGz1/D9uUMLvLWSLcXer/535 XxsvBMnU8jSGtITRc+n3JVRBFmGqxq4Atc5KDn8aFuBH0HqEZWynA3sDIr+3CbLE65dE d6ftY1UNSOOKDNIm+Fqf72P74KM4xsGIuyF4USpv4ucPMJh3a/+bTaf30e3EzUKGLoj0 bD5bJN938t2FqhxVV/AqpRtNHS7KUOr4u2GXDI6wlexfWmm0hl4UPeXanReiZng+E4sA 7tSA== 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=0GwpCAVQMMnP4jhjSiLOp/3Fo46NWJcZZ9OzEAFdKkoOF+RSnG8fUokbqEkudrW+W0 ubeDhcZ/H+nINPpuY2lgLgqV+q43uAvRIp7SRfFSBDJgKGc3LS/4mWmBIwHBIpjStX8e 15+7zTJWnXzdZCf32cLiBZ+DgNccT36fhmuJHeku0GSep7DfFFwJ6WsD+VyMkn/rNgfL dY95m9OrflPudczIfzpnYPSiBFTmpfRPJZL73exjHiu3CIrVZ9ldiKEuJ2Ah6x0d/DC6 UKn+uc4ImngLGKsUJDIqvm9Ykw/9quija+MX+yqCMvP9jJ++f3tzzLh9mGouas8FMn/n v0iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=puq8u2ML; 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 w8-20020aa79548000000b00561cb07c77csi27461281pfq.232.2022.10.22.00.39.37; Sat, 22 Oct 2022 00:39:49 -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=puq8u2ML; 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 S230384AbiJVHjL (ORCPT + 99 others); Sat, 22 Oct 2022 03:39:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230440AbiJVHii (ORCPT ); Sat, 22 Oct 2022 03:38:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE4DB25CDA8; Sat, 22 Oct 2022 00:36:01 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 0A18660ADD; Sat, 22 Oct 2022 07:36:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FC1EC433C1; Sat, 22 Oct 2022 07:35:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424159; bh=pz2UwXMRKNrNA4L+NtDLBqs3w52XvYBv/P4Jt38nelM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=puq8u2MLIYdvKdQwLvc8YMM1kEXdx6mkNQYpECwLUd6BQUxYXz3gfyn+ANDsIZTjU pQlniGL1BUlSkFIkP0Gt/yhqLKhshFLaC0pmxDvrITPZRK5KpUaBbAbSuvXTCkFao0 FwawAg9R+h0bb5CabbEr1FapBDqSNbfK8ttfRWmI= 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.19 046/717] hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API Date: Sat, 22 Oct 2022 09:18:45 +0200 Message-Id: <20221022072423.257748921@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747372620872960263?= X-GMAIL-MSGID: =?utf-8?q?1747372620872960263?= 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");