Patchwork [3.5.y.z,extended,stable] Patch "tg3: Avoid null pointer dereference in tg3_interrupt in" has been added to staging queue

mail settings
Submitter Herton Ronaldo Krzesinski
Date Feb. 15, 2013, 3:12 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/220615/
State New
Headers show


Herton Ronaldo Krzesinski - Feb. 15, 2013, 3:12 a.m.
This is a note to let you know that I have just added a patch titled

    tg3: Avoid null pointer dereference in tg3_interrupt in

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see



From d18bb20f1f856eb05730ddc484632117e727a6b9 Mon Sep 17 00:00:00 2001
From: Nithin Nayak Sujir <>
Date: Mon, 14 Jan 2013 17:10:59 +0000
Subject: [PATCH] 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 <>
Signed-off-by: Michael Chan <>
Signed-off-by: David S. Miller <>
Signed-off-by: Herton Ronaldo Krzesinski <>
 drivers/net/ethernet/broadcom/tg3.c |    4 ++++
 1 file changed, 4 insertions(+)



diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 15f8b00..82a8ed2 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -6594,6 +6594,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]);
@@ -15556,6 +15559,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;