Message ID | 20221108141917.46796-1-judy.chenhui@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2717160wru; Tue, 8 Nov 2022 05:51:03 -0800 (PST) X-Google-Smtp-Source: AMsMyM5RuQhtwnA0FRcVmQgzgp2RXIDoAsULj+BKc6GraJGYgHJaoqAFm4L2IkUZgOmUKxX3P/sQ X-Received: by 2002:a63:215f:0:b0:46f:c464:a054 with SMTP id s31-20020a63215f000000b0046fc464a054mr38879788pgm.420.1667915462751; Tue, 08 Nov 2022 05:51:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667915462; cv=none; d=google.com; s=arc-20160816; b=CIKb5d+BWWkXAhMeQZn8Q2ChHbSnJ6EmN2WKZIFtXBX8JsaGk/Rw1AufQXDvK9ivhL gHTfAXzphfcCiP0IfpkCP+hSZvySnwX9OtxO4y5d9hOOSPC7qsFQKLf1lG84HAaA5q7H xjAKaMMs/2Mcu/0mfP9eWaInc4aiEe5cPzjK8TkLZSHrygC3yPdVcZxbvXZ8Wk1CNyiw uEcUHb8D6oMlMb4GRxhb4rNVzDfSbr7gIT8zsVcN52MjEJTZ3Q7Z6ekv+R0ptlYGLvzW XEffp8bPbojNCZD1vcnlJYqamNS8kt7EqJ0FoP2oxbzzbNjKe49LkihvRfEKby4U0ArT XYYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=fmsyc8Fg4ESfggTVqL5iCL1HswH0Gf0GIO2pKGzdkvc=; b=Ri3TiGbc8Xc3B6G6FlbEOeujfEyL6jURvu0tucsL9end/Cq395VHG9DkTIBnpnbab3 NZLZ3JzL4fANUvcVLWJqGPnkq5YtiM1Nj6WGeekqTIE3eGO/56Cs+TQJYiSBFkDmnQxm cDpg+pcwvtPnECE8O9L5jSB8UKAz2KDCW6famYYC8oyQxf1WzLXiV50YcY68JxAZM7KK bZxDsx4WwTBrmgHqkciUBcatWOpzDgkYDsvpoMbYzHjEqbLu0wNlQDgAkJWecaXFiMls qWPQE6xHPzI/DB9mof+u4Z6/tnCQV0fgA/JMqEy6wWN4hxXDN5piY9yfkfvZUd6oXuOl EJVA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l3-20020a17090aaa8300b002130f4827afsi13208362pjq.87.2022.11.08.05.50.49; Tue, 08 Nov 2022 05:51:02 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234650AbiKHNu2 (ORCPT <rfc822;david.rheinsberg@gmail.com> + 99 others); Tue, 8 Nov 2022 08:50:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234643AbiKHNu0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 8 Nov 2022 08:50:26 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D06CC101E5; Tue, 8 Nov 2022 05:50:24 -0800 (PST) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N68c715sfzHvbL; Tue, 8 Nov 2022 21:49:59 +0800 (CST) Received: from dggpemm500008.china.huawei.com (7.185.36.136) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 8 Nov 2022 21:50:23 +0800 Received: from huawei.com (10.67.174.191) by dggpemm500008.china.huawei.com (7.185.36.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 8 Nov 2022 21:50:22 +0800 From: Chen Hui <judy.chenhui@huawei.com> To: <tony@atomide.com>, <linux@armlinux.org.uk>, <santosh.shilimkar@ti.com> CC: <linux-omap@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>, <judy.chenhui@huawei.com>, <yusongping@huawei.com> Subject: [PATCH] arch: arm: Fix memory leak in realtime_counter_init() Date: Tue, 8 Nov 2022 22:19:17 +0800 Message-ID: <20221108141917.46796-1-judy.chenhui@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.174.191] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500008.china.huawei.com (7.185.36.136) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748936124285895582?= X-GMAIL-MSGID: =?utf-8?q?1748936124285895582?= |
Series |
arch: arm: Fix memory leak in realtime_counter_init()
|
|
Commit Message
Chen Hui
Nov. 8, 2022, 2:19 p.m. UTC
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 <judy.chenhui@huawei.com>
---
arch/arm/mach-omap2/timer.c | 1 +
1 file changed, 1 insertion(+)
Comments
* Chen Hui <judy.chenhui@huawei.com> [221108 15:40]: > The "sys_clk" resource is malloced by clk_get(), > it is not released when the function return. Sorry for the delays, I'll apply this for v6.3 after v6.2-rc1 is available. Regards, Tony
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 620ba69c8f11..5677c4a08f37 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -76,6 +76,7 @@ static void __init realtime_counter_init(void) } rate = clk_get_rate(sys_clk); + clk_put(sys_clk); if (soc_is_dra7xx()) { /*