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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Oct 2018 07:27:23 +0000 (09:27 +0200)
commit887361696fb9e2c5b99e39c8d0dbacbe46ff92f9
tree118ab1f48f0dfddd1d313198c0b369555e2e360a
parent8e2e2192eb35eb24eb99f120b78eed0b104092b2
clocksource/drivers/timer-atmel-pit: Properly handle error cases

commit 52bf4a900d9cede3eb14982d0f2c5e6db6d97cc3 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clocksource/timer-atmel-pit.c