Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4367273imw; Tue, 19 Jul 2022 05:27:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vONafbtbj5mkKHUNn9oSzq6QRGU+DyhG7YpmQ1DC024RxF4keUsHliRru5Y+JVIjDs2TKA X-Received: by 2002:a05:6402:cba:b0:43a:6b17:f6b5 with SMTP id cn26-20020a0564020cba00b0043a6b17f6b5mr44325525edb.330.1658233624033; Tue, 19 Jul 2022 05:27:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658233624; cv=none; d=google.com; s=arc-20160816; b=xkyb+NW5fgz2/y+oL8V3lRgUZNjKIynoy+IS/c45ccfJXDsU0WOLEZc8e3PGLpgRIn wuDls3IRzPUPrfc1YQQiqXUykyQGoTDJgUEDYk6FPRS4vOgiyTPaVJYXZXOSXJwuTuxH qUv48fiLCaY1wn7e5iVQUZ9Pxq44KEo+FB+hIjxU9fN4MAg3fhSs+xSIJBDMPTKJTiwF nArQfBiA9Ee0unHeJPtghVDEleclQ/Ir1a7dlnvENvfJfvZivFBOALm8WDVgmLZ3m5jk S9uyJZVT0huORgkJ8oH2d6JOHBGq9bHm8Y/+AkHGlmnElZgVqdEfvscW+TsquHd17tNw eApw== 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=x2eOMJXIAQTlZ6Gs47hoUqRSS6WC6VfYc0lTwnvzBYU=; b=ylohyyRzy87JOhIUa2NOSt5EB3VbJ0gMZTQOsOmiwBW53cuudZYG9CAWjccQbx3Wjf Ay0+6+vrTKqoRtZkwZsPwybrBJjXJFiN9rtuJdgAYpEfnTRbXLb20K+bIIUMJlXXK81A laMGpGSbSRsIDR3bWQU0mZnlx/tdRhgjU5yMd+c7fAWG2T95v1pgm98ldncDOblHNv63 VSutnRvAdZ/bXYoErD/9Xmmh7AoyacU5ypTn7fHkD8QlO1KynrMl8A1VZDit6l+gv7Ox WUxx67SmdIi5bHQ2J2f6ruZQv0x1+xt4Ga1Ff+uH0H5BPtE7m5eINLrg/AZcbEOzgYzn nggw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dm3sV1Kw; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg7-20020a1709072cc700b0072f6119cba8si350842ejc.885.2022.07.19.05.26.39; Tue, 19 Jul 2022 05:27:04 -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=dm3sV1Kw; 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 S237490AbiGSL4R (ORCPT + 99 others); Tue, 19 Jul 2022 07:56:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237079AbiGSL4J (ORCPT ); Tue, 19 Jul 2022 07:56:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02059422E1; Tue, 19 Jul 2022 04:56:00 -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 4EF4AB81B29; Tue, 19 Jul 2022 11:55:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC554C341C6; Tue, 19 Jul 2022 11:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658231757; bh=BN3QKHWBFOVmDNAdkhEZg41UokDP2Y1qURVWKR6ME3Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dm3sV1KwyGeeOkVOe25kflfQ+dlXk3iO89o2nUt/snwxRn/T2h19ag+wYmgzBxDA8 5fpVFgkeURMKzkHkhYx/0+d/iNopm46njlupqkZXtkmaNir3Tva24VZ3U06e0I/y6Z EB+UCi4WgQZZMDcdI6i/DN41NChxqJgOV625d4hY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Viresh Kumar , Sasha Levin Subject: [PATCH 4.9 16/28] cpufreq: pmac32-cpufreq: Fix refcount leak bug Date: Tue, 19 Jul 2022 13:53:54 +0200 Message-Id: <20220719114457.778624491@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114455.701304968@linuxfoundation.org> References: <20220719114455.701304968@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 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 From: Liang He [ Upstream commit ccd7567d4b6cf187fdfa55f003a9e461ee629e36 ] In pmac_cpufreq_init_MacRISC3(), we need to add corresponding of_node_put() for the three node pointers whose refcount have been incremented by of_find_node_by_name(). Signed-off-by: Liang He Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- drivers/cpufreq/pmac32-cpufreq.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c index 641f8021855a..62e86f7ca04a 100644 --- a/drivers/cpufreq/pmac32-cpufreq.c +++ b/drivers/cpufreq/pmac32-cpufreq.c @@ -473,6 +473,10 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode) if (slew_done_gpio_np) slew_done_gpio = read_gpio(slew_done_gpio_np); + of_node_put(volt_gpio_np); + of_node_put(freq_gpio_np); + of_node_put(slew_done_gpio_np); + /* If we use the frequency GPIOs, calculate the min/max speeds based * on the bus frequencies */ -- 2.35.1