From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B29D3C6FD1F for ; Fri, 10 Mar 2023 14:16:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232051AbjCJOQO (ORCPT ); Fri, 10 Mar 2023 09:16:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231992AbjCJOPx (ORCPT ); Fri, 10 Mar 2023 09:15:53 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 847A911CBE2 for ; Fri, 10 Mar 2023 06:14:45 -0800 (PST) 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 25236B822AD for ; Fri, 10 Mar 2023 14:14:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 909C0C433EF; Fri, 10 Mar 2023 14:14:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678457682; bh=h45FqZ9Ieft4z0aLHcXFa3xiGJQXXHeHkhXUqcc5B6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pfvny06Tls4260NVaveh3O4d3oWnRsFDEdVHG8h/wn7+2Hi8Gvvf/W6zxtlrCz4kB 3d4wYpWMF7Il+n7HDi67ccWILm4vd/MKwEoPyvo4YtuEbb91YSXwK7karjrQZUh4Vb BtT8/m5dbnHuqNp+r7TmSc0JypwK8dJYn9nbwVjg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Chen Hui , Tony Lindgren , Sasha Levin Subject: [PATCH 4.19 004/252] ARM: OMAP2+: Fix memory leak in realtime_counter_init() Date: Fri, 10 Mar 2023 14:36:14 +0100 Message-Id: <20230310133718.942136744@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133718.803482157@linuxfoundation.org> References: <20230310133718.803482157@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Chen Hui [ Upstream commit ed8167cbf65c2b6ff6faeb0f96ded4d6d581e1ac ] The "sys_clk" resource is malloced by clk_get(), it is not released when the function return. Fixes: fa6d79d27614 ("ARM: OMAP: Add initialisation for the real-time counter.") Signed-off-by: Chen Hui Message-Id: <20221108141917.46796-1-judy.chenhui@huawei.com> Signed-off-by: Tony Lindgren Signed-off-by: Sasha Levin --- arch/arm/mach-omap2/timer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index c4ba848e8af62..d98aa78b9be91 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -701,6 +701,7 @@ static void __init realtime_counter_init(void) } rate = clk_get_rate(sys_clk); + clk_put(sys_clk); if (soc_is_dra7xx()) { /* -- 2.39.2