Skip to contentSkip to conversation

drivers/net/acenic.c: fix check-after-use

PATCH Applied Adrian Bunk 2 participants 2 messages Jul 23, 2007 – Jul 24, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/net/acenic.c: fix check-after-use

The Coverity checker noted that we've already dereferenced "dev" when we check whether it's NULL.

Since it's impossible that "dev" is NULL at this place this patch removes the NULL check.

---

drivers/net/acenic.c renamed from drivers/net/acenic.c.old +0 -6
@@ -3124,20 +3124,14 @@ static int __devinit read_eeprom_byte(st
 	struct ace_private *ap = netdev_priv(dev);
 	struct ace_regs __iomem *regs = ap->regs;
 	unsigned long flags;
 	u32 local;
 	int result = 0;
 	short i;
 
-	if (!dev) {
-		printk(KERN_ERR "No device!\n");
-		result = -ENODEV;
-		goto out;
-	}
-
 	/*
 	 * Don't take interrupts on this CPU will bit banging
 	 * the %#%#@$ I2C device
 	 */
 	local_irq_save(flags);
 
 	eeprom_start(regs);
Applied
#1 lore raw
Quoted 5 lines · Adrian Bunk

The Coverity checker noted that we've already dereferenced "dev" when we check whether it's NULL.

Since it's impossible that "dev" is NULL at this place this patch removes the NULL check.

applied