lkml.org 
[lkml]   [2019]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] clocksource/drivers/davinci: Fix memory leak in davinci_timer_register
From
Date
> In the impelementation of davinci_timer_register() the allocated memory
> for clockevent should be released if request_irq() fails.

* Please avoid the copying of typos from previous change descriptions.

* Under which circumstances will an “imperative mood” matter for you here?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=7d194c2100ad2a6dded545887d02754948ca5241#n151


> +++ 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;
> }

* Should a complete source code analysis point out that a similar fix
will be needed also in the if branch after a failed call of
the function “clocksource_register_hz”?

* Can any more exception handling become relevant because of previous
resource allocations in this function implementation?

Regards,
Markus

\
 
 \ /
  Last update: 2019-10-22 11:13    [W:0.044 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site