From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Julia Lawall <julia@diku.dk>
Cc: Ralf Baechle <ralf@linux-mips.org>,
linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/11] arch/mips/sni: Correct NULL test
Date: Sat, 6 Feb 2010 10:52:18 +0100 [thread overview]
Message-ID: <20100206095218.GA7185@alpha.franken.de> (raw)
In-Reply-To: <Pine.LNX.4.64.1002060942010.8092@ask.diku.dk>
On Sat, Feb 06, 2010 at 09:42:16AM +0100, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
>
> Test the value that was just allocated rather than the previously tested one.
>
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @r@
> expression *x;
> expression e;
> identifier l;
> @@
>
> if (x == NULL || ...) {
> ... when forall
> return ...; }
> ... when != goto l;
> when != x = e
> when != &x
> *x == NULL
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
> send
> ---
> arch/mips/sni/rm200.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/mips/sni/rm200.c b/arch/mips/sni/rm200.c
> index 46f0069..31e2583 100644
> --- a/arch/mips/sni/rm200.c
> +++ b/arch/mips/sni/rm200.c
> @@ -404,7 +404,7 @@ void __init sni_rm200_i8259_irqs(void)
> if (!rm200_pic_master)
> return;
> rm200_pic_slave = ioremap_nocache(0x160000a0, 4);
> - if (!rm200_pic_master) {
> + if (!rm200_pic_slave) {
> iounmap(rm200_pic_master);
> return;
> }
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Thanks for fixing.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea. [ RFC1925, 2.3 ]
prev parent reply other threads:[~2010-02-06 9:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-06 8:42 [PATCH 2/11] arch/mips/sni: Correct NULL test Julia Lawall
2010-02-06 9:52 ` Thomas Bogendoerfer [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=20100206095218.GA7185@alpha.franken.de \
--to=tsbogend@alpha.franken.de \
--cc=julia@diku.dk \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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