[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1298979207-11237-1-git-send-email-huzaifas@redhat.com>
Date: Tue, 1 Mar 2011 17:03:27 +0530
From: huzaifas@...hat.com
To: netdev@...r.kernel.org
Cc: geert@...ux-m68k.org, tj@...nel.org, davem@...emloft.net,
eric.dumazet@...il.com, Huzaifa Sidhpurwala <huzaifas@...hat.com>
Subject: [PATCH] Fix possible null pointer dereference in ariadne.c
From: Huzaifa Sidhpurwala <huzaifas@...hat.com>
Make sure dev exists before referencing it
Signed-off-by: Huzaifa Sidhpurwala <huzaifas@...hat.com>
---
drivers/net/ariadne.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ariadne.c b/drivers/net/ariadne.c
index 39214e5..fc3c762 100644
--- a/drivers/net/ariadne.c
+++ b/drivers/net/ariadne.c
@@ -420,7 +420,7 @@ static inline void ariadne_reset(struct net_device *dev)
static irqreturn_t ariadne_interrupt(int irq, void *data)
{
struct net_device *dev = (struct net_device *)data;
- volatile struct Am79C960 *lance = (struct Am79C960*)dev->base_addr;
+ volatile struct Am79C960 *lance;
struct ariadne_private *priv;
int csr0, boguscnt;
int handled = 0;
@@ -430,6 +430,7 @@ static irqreturn_t ariadne_interrupt(int irq, void *data)
return IRQ_NONE;
}
+ *lance = (struct Am79C960*)dev->base_addr;
lance->RAP = CSR0; /* PCnet-ISA Controller Status */
if (!(lance->RDP & INTR)) /* Check if any interrupt has been */
--
1.7.3.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists