]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: sun6i: ensure rtc is kfree'd on error
authorColin Ian King <colin.king@canonical.com>
Wed, 22 Nov 2017 17:16:18 +0000 (17:16 +0000)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Mon, 18 Dec 2017 22:05:10 +0000 (23:05 +0100)
commit59cd0ac3c11604a308603e34a389001639b6d2a8
treec3a6510272d19ac97b44b316d6be4ae775de6c4d
parent6a35ace54c6a5887ba6f231c55ed84942f209808
rtc: sun6i: ensure rtc is kfree'd on error

The error return path on clk_data allocation failure does not kfree
the allocated rtc object. Fix this with a kfree of rtc on the error
exit path.

Detected by CoverityScan, CID#1452264 ("Resource Leak")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-sun6i.c