summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMicah Gruber <micah.gruber@gmail.com>2007-07-24 04:44:56 +0200
committerJeff Garzik <jeff@garzik.org>2007-07-30 21:58:54 +0200
commitc196d80f994ef4ffefd5a7c62e3f42bd75d538bc (patch)
tree324724a86e675d468c625e419aa99fb60d09c155 /drivers
parentPATCH kernel 2.6.22] PCMCIA-NETDEV : modify smc91c92_cs.c to become SMP safe (diff)
downloadlinux-c196d80f994ef4ffefd5a7c62e3f42bd75d538bc.tar.xz
linux-c196d80f994ef4ffefd5a7c62e3f42bd75d538bc.zip
Fix a potential NULL pointer dereference in mace_interrupt() in drivers/net/pcmcia/nmclan_cs.c
This patch fixes a potential null dereference bug where we dereference DEV before a null check. This patch simply moves the dereferencing after the null check. Signed-off-by: Micah Gruber <micah.gruber@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 73da611fd536..997c2d0c83bb 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -996,7 +996,7 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id)
{
struct net_device *dev = (struct net_device *) dev_id;
mace_private *lp = netdev_priv(dev);
- kio_addr_t ioaddr = dev->base_addr;
+ kio_addr_t ioaddr;
int status;
int IntrCnt = MACE_MAX_IR_ITERATIONS;
@@ -1006,6 +1006,8 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id)
return IRQ_NONE;
}
+ ioaddr = dev->base_addr;
+
if (lp->tx_irq_disabled) {
printk(
(lp->tx_irq_disabled?