locking/atomics: Fix memory leak in bcm2835_timer_init
Subsystems (3)
PATCH 1/1 locking/atomics: Fix memory leak in bcm2835_timer_init
In the impelementation of bcm2835_timer_init() the allocated memory for timer should be released if setup_irq() fails.
Fixes 84c39b8b7d46 ("clocksource/drivers/bcm2835_timer: Unmap region obtained by of_iomap")
Signed-off-by Navid Emamdoost <[email protected]>
--- drivers/clocksource/bcm2835_timer.c | 1 + 1 file changed, 1 insertion(+)
drivers/clocksource/bcm2835_timer.c +1 -0
@@ -121,6 +121,7 @@ static int __init bcm2835_timer_init(struct device_node *node) ret =setup_irq (irq, &timer->act);if (ret) {pr_err ("Can't set up timer IRQ\n" ); +kfree (timer); goto err_iounmap; }
Signature · 1 line
2.17.1
Quoted 2 lines · Navid Emamdoost
In the impelementation of
bcm2835_timer_init()the allocated memory for timer should be released ifsetup_irq()fails.
s/impelementation/implementation/ and also the subject should probably be changed to better reflect the scope of the patch. With that:
Reviewed-by Florian Fainelli <[email protected]>
Quoted 20 lines
Fixes 84c39b8b7d46 ("clocksource/drivers/bcm2835_timer: Unmap region obtained by of_iomap")Signed-off-by Navid Emamdoost <[email protected]>--- drivers/clocksource/bcm2835_timer.c | 1 + 1 file changed, 1 insertion(+)drivers/clocksource/bcm2835_timer.c +1
-0@@ -121,6 +121,7 @@ static int __init bcm2835_timer_init(struct device_node *node) ret =setup_irq (irq, &timer->act);if (ret) {pr_err ("Can't set up timer IRQ\n" ); +kfree (timer); goto err_iounmap; }
Signature · 1 line
Florian