Skip to contentSkip to conversation

Fix a potential NULL pointer dereference in uli526x_interrupt() in drivers/net/tulip/uli526x.c

PATCH In review [email protected] 2 participants 2 messages Oct 2, 2007

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

PATCH 6/13 Fix a potential NULL pointer dereference in uli526x_interrupt() in drivers/net/tulip/uli526x.c

From: Micah Gruber <[email protected]>

This patch fixes an apparent potential null dereference bug where we dereference dev before a null check. This patch simply remvoes the can't-happen test for a null pointer.

---

 drivers/net/tulip/uli526x.c |    5 -----
 1 file changed, 5 deletions(-)
drivers/net/tulip/uli526x.c renamed from drivers/net/tulip/uli526x.c~fix-a-potential-null-pointer-dereference-in-uli526x_interrupt +0 -5
diff -puN drivers/net/tulip/uli526x.c~fix-a-potential-null-pointer-dereference-in-uli526x_interrupt drivers/net/tulip/uli526x.c
@@ -664,11 +664,6 @@ static irqreturn_t uli526x_interrupt(int
 	unsigned long ioaddr = dev->base_addr;
 	unsigned long flags;
 
-	if (!dev) {
-		ULI526X_DBUG(1, "uli526x_interrupt() without DEVICE arg", 0);
-		return IRQ_NONE;
-	}
-
 	spin_lock_irqsave(&db->lock, flags);
 	outl(0, ioaddr + DCR7);
 

_

Acked-by on v1 6/13
#1 lore raw
Quoted 8 lines · On Tue, Oct 02, 2007 at 02:11:38PM -0700, [email protected] wrote:

From: Micah Gruber <[email protected]>

This patch fixes an apparent potential null dereference bug where we dereference dev before a null check. This patch simply remvoes the can't-happen test for a null pointer.

Cc Grant Grundler <[email protected]>

thanks!
grant

Quoted 24 lines

---

 drivers/net/tulip/uli526x.c |    5 -----
 1 file changed, 5 deletions(-)

diff -puN drivers/net/tulip/uli526x.c~fix-a-potential-null-pointer-dereference-in-uli526x_interrupt drivers/net/tulip/uli526x.c

drivers/net/tulip/uli526x.c renamed from drivers/net/tulip/uli526x.c~fix-a-potential-null-pointer-dereference-in-uli526x_interrupt +0 -5
@@ -664,11 +664,6 @@ static irqreturn_t uli526x_interrupt(int
 	unsigned long ioaddr = dev->base_addr;
 	unsigned long flags;
 
-	if (!dev) {
-		ULI526X_DBUG(1, "uli526x_interrupt() without DEVICE arg", 0);
-		return IRQ_NONE;
-	}
-
 	spin_lock_irqsave(&db->lock, flags);
 	outl(0, ioaddr + DCR7);
 

_