Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4371786imw; Tue, 19 Jul 2022 05:32:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vevVqjd0EYUbbz09IeEcv6OA5TstKlhy6zLXJxBgP5tlSOsFYVMMBYdwiFjXuCWi3XgZGq X-Received: by 2002:a17:907:b02:b0:72b:6162:b47f with SMTP id h2-20020a1709070b0200b0072b6162b47fmr29077412ejl.245.1658233943375; Tue, 19 Jul 2022 05:32:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658233943; cv=none; d=google.com; s=arc-20160816; b=AU/LnLaGjm5BgOgikdaLv+pCaQgT02jlR3ob19raIvb/xp4nYnJCny8VU4dHtdDQ+O Cz9c8ukDXbRPAwktNLkWP2MzUNj8YinpHPWADtWkVT3IhH9nI17cXwuFDCRa9AieXV91 IWE5zLjjv1oau2jgmlN2jys4mmakAmECztyQdbLHFm3g7P4/em1I+PO1KFHqKC8pb1tX FtdEyk1qLqVHYdDO7r7NUCXdzxb6RyS3SKwmWATuL75UronB/VBerR4ko9GK11qqcHaX KweP7m631vq/mU6RNECMgkwzpC0olJ+8H9jOqm8JqXXtiq4R0JITH1Wwkm3OGPn63ljO yqYA== 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=HIUXf14mV3wLrNWYxpfGYUW+5we0bf56rySpE1vuAK4=; b=bGkGmIhXLZ36EyzyxTDywLYU8f7cL9wj+AJmSQ71Zx9tei7ria29d9uOmj32Ghee91 ety6O2WSOoWk/vqfj3t7Igm4+SLpogIiSqt0AL4HXOx2L09TJTIm0O4VkqE2ZQYGtrej 2LWY3i9jRpBrrVmFIcrqJJmVUh240SXuLxSAP8Ej/MQWGfUW9XpytRZeNcfGWYhFGCsd G0qNJcmP2iIkYio5x1omWC97R0UiUuQVi2vODG+jTz1NTvSf079tPGzeJdvT8JXJyl1Q zSLXdE3rZk3vq78Qq+seDdGo7Iig2ouCgxfg53+ho2dT9tTo2U0o6fgMuc9ORLp+UaZV TTKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=huqPus7c; 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 ko18-20020a170907987200b00726b4533cd1si19308503ejc.170.2022.07.19.05.31.58; Tue, 19 Jul 2022 05:32:23 -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=huqPus7c; 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 S238274AbiGSMHU (ORCPT + 99 others); Tue, 19 Jul 2022 08:07:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238253AbiGSMGH (ORCPT ); Tue, 19 Jul 2022 08:06:07 -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 2A2F04D811; Tue, 19 Jul 2022 05:01:02 -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 12BB7616D9; Tue, 19 Jul 2022 12:01:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0084C341C6; Tue, 19 Jul 2022 12:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232061; bh=86GZffUJNDdRz1Q8/xH57X1zgjufQMhaT9F2jEs4Lh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=huqPus7c4kgoG1OCrRwdU9cfi5IogNgWD404QI+FBJii/p4IawL3vEqR/dN4cNNlK y3ZmZswdNmhKzG68iQ90hh1LKFsvLTwsMX7L3Mt8laaVXRIcN3ufKPqtyJpMt/dj5v zdznTbjeoOkE3gL61/IAtTvljigHziA+j0gPnOvk= 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.19 30/48] cpufreq: pmac32-cpufreq: Fix refcount leak bug Date: Tue, 19 Jul 2022 13:54:07 +0200 Message-Id: <20220719114522.563744024@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114518.915546280@linuxfoundation.org> References: <20220719114518.915546280@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 e225edb5c359..ce0dda1a4241 100644 --- a/drivers/cpufreq/pmac32-cpufreq.c +++ b/drivers/cpufreq/pmac32-cpufreq.c @@ -474,6 +474,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