Messages in this thread | | | Date | Sat, 18 Mar 2023 05:31:24 -0700 | From | Guenter Roeck <> | 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@hust.edu.cn> > Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
Please just use devm_ioremap() and devm_memremap().
Thanks, Guenter
| |