From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] PM / Hibernate: NULL dereferences on error paths
Date: Sat, 08 Oct 2011 10:49:14 +0000 [thread overview]
Message-ID: <20111008104914.GQ30887@longonot.mountain> (raw)
In-Reply-To: <20111007132453.GA31424@elgon.mountain>
On Sat, Oct 08, 2011 at 09:28:48PM +1100, Bojan Smojver wrote:
> +out_clean:
> + if (data) {
> + for (thr = 0; thr < nr_threads; thr++) {
> + if (data[thr].thr)
> + kthread_stop(data[thr].thr);
> + }
> + vfree(data);
> + }
> + if (page) free_page((unsigned long)page);
>
This obviously works, but why don't you use a normal kernel unwind
style? You tried this complicated error handling before and it
already caused bugs... It's simpler if the error handling code has
no if statements.
regards,
dan carpenter
next prev parent reply other threads:[~2011-10-08 10:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-07 13:24 [patch] PM / Hibernate: NULL dereferences on error paths Dan Carpenter
2011-10-07 20:58 ` Bojan Smojver
2011-10-08 10:25 ` Bojan Smojver
2011-10-08 10:28 ` Bojan Smojver
2011-10-08 10:49 ` Dan Carpenter [this message]
2011-10-08 13:11 ` Bojan Smojver
2011-10-09 14:11 ` Dan Carpenter
2011-10-09 22:26 ` Bojan Smojver
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=20111008104914.GQ30887@longonot.mountain \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
/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