broken null test in s390 claw driver

From: Dave Jones
Date: Thu Jun 22 2006 - 22:02:35 EST


Whoops, better hope this never gets passed a null dev in its current state.

Signed-off-by: Dave Jones <davej@xxxxxxxxxx>

--- linux-2.6/drivers/s390/net/claw.c~ 2006-06-22 22:01:33.000000000 -0400
+++ linux-2.6/drivers/s390/net/claw.c 2006-06-22 22:02:19.000000000 -0400
@@ -529,7 +529,7 @@ claw_open(struct net_device *dev)
printk(KERN_INFO "%s:%s Enter \n",dev->name,__FUNCTION__);
#endif
CLAW_DBF_TEXT(4,trace,"open");
- if (!dev | (dev->name[0] == 0x00)) {
+ if (!dev || (dev->name[0] == 0x00)) {
CLAW_DBF_TEXT(2,trace,"BadDev");
printk(KERN_WARNING "claw: Bad device at open failing \n");
return -ENODEV;

--
http://www.codemonkey.org.uk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/