From: Markus Elfring <Markus.Elfring@web.de>
To: Navid Emamdoost <navid.emamdoost@gmail.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
kernel-janitors@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Navid Emamdoost <emamd001@umn.edu>,
Kangjie Lu <kjlu@umn.edu>, Stephen McCamant <smccaman@umn.edu>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] clocksource/drivers/davinci: Fix memory leak in davinci_timer_register
Date: Tue, 22 Oct 2019 11:12:39 +0200 [thread overview]
Message-ID: <1d9f02d3-45ac-1d2f-457b-91cae123383d@web.de> (raw)
In-Reply-To: <20191021202626.5246-1-navid.emamdoost@gmail.com>
> 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
next prev parent reply other threads:[~2019-10-22 9:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-21 20:26 Navid Emamdoost
2019-10-22 9:12 ` Markus Elfring [this message]
2019-10-22 9:32 ` Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1d9f02d3-45ac-1d2f-457b-91cae123383d@web.de \
--to=markus.elfring@web.de \
--cc=bgolaszewski@baylibre.com \
--cc=daniel.lezcano@linaro.org \
--cc=emamd001@umn.edu \
--cc=kernel-janitors@vger.kernel.org \
--cc=kjlu@umn.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=navid.emamdoost@gmail.com \
--cc=smccaman@umn.edu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®