mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
rtc: pl031: fix resource leak in pl031_probe
[ Upstream commit 1eab0fea25
]
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>
This commit is contained in:
parent
e2926630f6
commit
a95049c514
1 changed files with 4 additions and 2 deletions
|
@ -379,8 +379,10 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
|
|||
|
||||
device_init_wakeup(&adev->dev, true);
|
||||
ldata->rtc = devm_rtc_allocate_device(&adev->dev);
|
||||
if (IS_ERR(ldata->rtc))
|
||||
return PTR_ERR(ldata->rtc);
|
||||
if (IS_ERR(ldata->rtc)) {
|
||||
ret = PTR_ERR(ldata->rtc);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ldata->rtc->ops = ops;
|
||||
|
||||
|
|
Loading…
Reference in a new issue