Skip to content

Commit

Permalink
Fix a potential NULL pointer dereference in mace_interrupt() in drive…
Browse files Browse the repository at this point in the history
…rs/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>
  • Loading branch information
Micah Gruber authored and Jeff Garzik committed Jul 30, 2007
1 parent 85e2783 commit c196d80
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/pcmcia/nmclan_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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?
Expand Down

0 comments on commit c196d80

Please sign in to comment.