diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2007-09-29 01:42:09 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:53:51 -0400 |
commit | bcfef8c3681fa59b653871682956a8fdf5c27c5a (patch) | |
tree | 7fa3c9df43063f00474c1ca00066728cd3136c6a /drivers/net | |
parent | 0da18e3883d18ac716ad8cc07df9bd30933807ac (diff) |
Avoid possible NULL pointer deref in 3c359 driver
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/tokenring/3c359.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c index 88d03c085d54..7224d368b2a7 100644 --- a/drivers/net/tokenring/3c359.c +++ b/drivers/net/tokenring/3c359.c | |||
@@ -1045,11 +1045,6 @@ static irqreturn_t xl_interrupt(int irq, void *dev_id) | |||
1045 | u8 __iomem * xl_mmio = xl_priv->xl_mmio ; | 1045 | u8 __iomem * xl_mmio = xl_priv->xl_mmio ; |
1046 | u16 intstatus, macstatus ; | 1046 | u16 intstatus, macstatus ; |
1047 | 1047 | ||
1048 | if (!dev) { | ||
1049 | printk(KERN_WARNING "Device structure dead, aaahhhh !\n") ; | ||
1050 | return IRQ_NONE; | ||
1051 | } | ||
1052 | |||
1053 | intstatus = readw(xl_mmio + MMIO_INTSTATUS) ; | 1048 | intstatus = readw(xl_mmio + MMIO_INTSTATUS) ; |
1054 | 1049 | ||
1055 | if (!(intstatus & 1)) /* We didn't generate the interrupt */ | 1050 | if (!(intstatus & 1)) /* We didn't generate the interrupt */ |