提交 c2d5b5e5 编写于 作者: J Julia Lawall 提交者: Ralf Baechle

MIPS: SNI: Correct NULL test

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: NJulia Lawall <julia@diku.dk>
To: linux-mips@linux-mips.org
To: linux-kernel@vger.kernel.org
To: kernel-janitors@vger.kernel.org
Patchwork: http://patchwork.linux-mips.org/patch/945/Acked-by: NThomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 63731c96
...@@ -404,7 +404,7 @@ void __init sni_rm200_i8259_irqs(void) ...@@ -404,7 +404,7 @@ void __init sni_rm200_i8259_irqs(void)
if (!rm200_pic_master) if (!rm200_pic_master)
return; return;
rm200_pic_slave = ioremap_nocache(0x160000a0, 4); rm200_pic_slave = ioremap_nocache(0x160000a0, 4);
if (!rm200_pic_master) { if (!rm200_pic_slave) {
iounmap(rm200_pic_master); iounmap(rm200_pic_master);
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册