OSDN Git Service

rtc: sun6i: ensure clk_data is kfree'd on error
authorColin Ian King <colin.king@canonical.com>
Wed, 19 Jul 2017 16:57:02 +0000 (17:57 +0100)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sun, 30 Jul 2017 22:17:46 +0000 (00:17 +0200)
commit1a37c34811f6d115063042a17211cd70ab560ddd
tree61de99dbb3469748df0ea9880e58d6c4ded0a4c8
parent319ff835d6136842c660011047a480119bd7cba8
rtc: sun6i: ensure clk_data is kfree'd on error

There are two error return paths that do not kfree clk_data and
we end up with a memory leak. Fix these with a kfree error exit
path.

Detected by CoverityScan, CID#1402959 ("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