Skip to content

Commit

Permalink
Avoid possible NULL pointer deref in 3c359 driver
Browse files Browse the repository at this point in the history
In xl_freemem(), if dev_if is NULL, the line

  struct xl_private *xl_priv =(struct xl_private *)dev->priv;

will cause a NULL pointer dereference.

(akpm: don't try to fix it: just delete the pointless test-for-null)

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Jesper Juhl authored and David S. Miller committed Oct 10, 2007
1 parent 0da18e3 commit bcfef8c
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/net/tokenring/3c359.c
Original file line number Diff line number Diff line change
Expand Up @@ -1045,11 +1045,6 @@ static irqreturn_t xl_interrupt(int irq, void *dev_id)
u8 __iomem * xl_mmio = xl_priv->xl_mmio ;
u16 intstatus, macstatus ;

if (!dev) {
printk(KERN_WARNING "Device structure dead, aaahhhh !\n") ;
return IRQ_NONE;
}

intstatus = readw(xl_mmio + MMIO_INTSTATUS) ;

if (!(intstatus & 1)) /* We didn't generate the interrupt */
Expand Down

0 comments on commit bcfef8c

Please sign in to comment.