clocksource/drivers/timer-atmel-pit: Properly handle error cases
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 25 Apr 2018 10:14:39 +0000 (12:14 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 27 Sep 2018 10:01:45 +0000 (12:01 +0200)
commit52bf4a900d9cede3eb14982d0f2c5e6db6d97cc3
tree906874b02bd01b43125047dc82aa700226c94cdb
parent4451d3f59f2a6f95e5d205c2d04ea072955d080d
clocksource/drivers/timer-atmel-pit: Properly handle error cases

The smatch utility reports a possible leak:

smatch warnings:
drivers/clocksource/timer-atmel-pit.c:183 at91sam926x_pit_dt_init() warn: possible memory leak of 'data'

Ensure data is freed before exiting with an error.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/clocksource/timer-atmel-pit.c