rtc: pl031: fix resource leak in pl031_probe
authorZheng Liang <zhengliang6@huawei.com>
Thu, 12 Nov 2020 09:31:39 +0000 (17:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Jan 2021 13:56:53 +0000 (14:56 +0100)
commitacc3c8cc27a80a6caa0b94e3800d190bbb6af830
tree12915528b78041a72d935f1d3a5ecd73c4a48d23
parent26058c397b9f67708d9d8b9207ab005da627c665
rtc: pl031: fix resource leak in pl031_probe

[ Upstream commit 1eab0fea2514b269e384c117f5b5772b882761f0 ]

When devm_rtc_allocate_device is failed in pl031_probe, it should release
mem regions with device.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zheng Liang <zhengliang6@huawei.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20201112093139.32566-1-zhengliang6@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/rtc/rtc-pl031.c