[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <332fc348-40c3-4471-9571-fc3fc0fe927e@roeck-us.net>
Date: Sat, 18 Mar 2023 05:31:24 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Tianyi Jing <jingfelix@...t.edu.cn>
Cc: Jean Delvare <jdelvare@...e.com>, Dongliang Mu <dzm91@...t.edu.cn>,
linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers: hwmon: fix ioremap and memremap leak
On Sat, Mar 18, 2023 at 07:27:11PM +0800, Tianyi Jing wrote:
> Smatch reports:
>
> drivers/hwmon/xgene-hwmon.c:757 xgene_hwmon_probe() warn:
> 'ctx->pcc_comm_addr' from ioremap() not released on line: 757.
>
> This is because in drivers/hwmon/xgene-hwmon.c:701 xgene_hwmon_probe(),
> ioremap and memremap is not released, which may cause a leak.
>
> To fix this, iounmap and memunmap is added to line: 754. And the
> declaration of 'version' is moved to xgene-hwmon.c:620 to help simplify
> getting 'version' below.
>
> Signed-off-by: Tianyi Jing <jingfelix@...t.edu.cn>
> Reviewed-by: Dongliang Mu <dzm91@...t.edu.cn>
Please just use devm_ioremap() and devm_memremap().
Thanks,
Guenter
Powered by blists - more mailing lists