[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMRc=MfpS+iTmoey0mSjH63Cm_fgfqjdebd07HY522bGcZv6dA@mail.gmail.com>
Date: Tue, 22 Oct 2019 11:32:43 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Navid Emamdoost <navid.emamdoost@...il.com>
Cc: emamd001@....edu, kjlu@....edu, smccaman@....edu,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] clocksource/drivers/davinci: Fix memory leak in davinci_timer_register
pon., 21 paź 2019 o 22:26 Navid Emamdoost <navid.emamdoost@...il.com>
napisał(a):
>
> In the impelementation of davinci_timer_register() the allocated memory
> for clockevent should be released if request_irq() fails.
>
> Fixes: 721154f972aa ("clocksource/drivers/davinci: Add support for clockevents")
> Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
> ---
> drivers/clocksource/timer-davinci.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/clocksource/timer-davinci.c b/drivers/clocksource/timer-davinci.c
> index 62745c962049..910d4d2f0d64 100644
> --- a/drivers/clocksource/timer-davinci.c
> +++ b/drivers/clocksource/timer-davinci.c
> @@ -299,6 +299,7 @@ int __init davinci_timer_register(struct clk *clk,
> "clockevent/tim12", clockevent);
> if (rv) {
> pr_err("Unable to request the clockevent interrupt");
> + kfree(clockevent);
> return rv;
> }
>
> --
> 2.17.1
>
Any failure in this driver means the system is fried. I explicitly
didn't bother freeing any resources. Nack.
Bart
Powered by blists - more mailing lists