aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorNithin Nayak Sujir <nsujir@broadcom.com>2013-01-14 17:10:59 +0000
committerPaul Gortmaker <paul.gortmaker@windriver.com>2014-02-10 16:11:01 -0500
commitcbdfb1a8b4d54cfe3ee17d0dba60f41ac87ce068 (patch)
tree746f1d77ab70db01d0f00711ea6fe4f08d99a182 /drivers
parentbd39784b505cd491d5ec8641f57fe35aeec32b4b (diff)
tg3: Avoid null pointer dereference in tg3_interrupt in netconsole mode
commit 9c13cb8bb477a83b9a3c9e5a5478a4e21294a760 upstream. When netconsole is enabled, logging messages generated during tg3_open can result in a null pointer dereference for the uninitialized tg3 status block. Use the irq_sync flag to disable polling in the early stages. irq_sync is cleared when the driver is enabling interrupts after all initialization is completed. Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> [PG: drivers/net/ethernet/broadcom/tg3.c --> drivers/net/tg3.c in .34] Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/tg3.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index ecc41cffb47..e6045d1998a 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -5278,6 +5278,9 @@ static void tg3_poll_controller(struct net_device *dev)
int i;
struct tg3 *tp = netdev_priv(dev);
+ if (tg3_irq_sync(tp))
+ return;
+
for (i = 0; i < tp->irq_cnt; i++)
tg3_interrupt(tp->napi[i].irq_vec, &tp->napi[i]);
}
@@ -14476,6 +14479,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
tp->pm_cap = pm_cap;
tp->rx_mode = TG3_DEF_RX_MODE;
tp->tx_mode = TG3_DEF_TX_MODE;
+ tp->irq_sync = 1;
if (tg3_debug > 0)
tp->msg_enable = tg3_debug;