]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
hwmon: (xgene) Fix ioremap and memremap leak
authorTianyi Jing <jingfelix@hust.edu.cn>
Sat, 18 Mar 2023 14:38:51 +0000 (22:38 +0800)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 21 Mar 2023 14:50:24 +0000 (07:50 -0700)
commit813cc94c7847ae4a17e9f744fb4dbdf7df6bd732
treef6d6f87f21770dac9a58aad6b9523ce0d1970de2
parent2315332efcbe7124252f080e03b57d3d2f1f4771
hwmon: (xgene) Fix ioremap and memremap leak

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, ioremap and memremap is modified to devm_ioremap and
devm_memremap.

Signed-off-by: Tianyi Jing <jingfelix@hust.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
Link: https://lore.kernel.org/r/20230318143851.2191625-1-jingfelix@hust.edu.cn
[groeck: Fixed formatting and subject]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/xgene-hwmon.c