From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] bus: sunxi-rsb: unlock on error in sunxi_rsb_read()
Date: Thu, 05 Nov 2015 06:07:51 +0000 [thread overview]
Message-ID: <20151105060751.GL7289@mwanda> (raw)
In-Reply-To: <20151103220244.GA19280@mwanda>
On Wed, Nov 04, 2015 at 10:22:35PM +0100, walter harms wrote:
> NTL one comment, if you looked it as success handling it may be uncommon
> but i you see it as "proctector" it is more obvious like
> if (f) free(f);
You shouldn't normally have those kinds of if statements because you
should handle the case of if "f" is NULL immediately. It shouldn't be a
question of "I'm half way through the function and I don't know what has
been allocated and what is free."
If you have an if condition like that it probably means you are doing
One Err style error handling and we all know my feelings about that. ;)
regards,
dan carpenter
prev parent reply other threads:[~2015-11-05 6:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 22:02 [patch] bus: sunxi-rsb: unlock on error in sunxi_rsb_read() Dan Carpenter
2015-11-04 12:19 ` walter harms
2015-11-04 12:34 ` Julia Lawall
2015-11-04 12:46 ` Dan Carpenter
2015-11-04 15:28 ` Chen-Yu Tsai
2015-11-04 15:51 ` Maxime Ripard
2015-11-04 21:22 ` walter harms
2015-11-05 6:07 ` Dan Carpenter [this message]
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=20151105060751.GL7289@mwanda \
--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;
as well as URLs for NNTP newsgroup(s).