login
Header Space

 
 

Re: tg3: unable to handle null pointer dereference [Re: Linux 2.6.21-rc6]

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Nishanth Aravamudan <nacc@...>, <davem@...>
Cc: Linus Torvalds <torvalds@...>, LKML <linux-kernel@...>, <netdev@...>
Date: Friday, April 6, 2007 - 6:57 pm

On Fri, 2007-04-06 at 14:40 -0700, Nishanth Aravamudan wrote:


Sorry, I think this should fix it:

[TG3]: Fix crash during tg3_init_one().

The driver will crash when the chip has been initialized by EFI before
tg3_init_one().  In this case, the driver will call tg3_chip_reset()
before allocating consistent memory.

The bug is fixed by checking for tp->hw_status before accessing it
during tg3_chip_reset().

Signed-off-by: Michael Chan <mchan@broadcom.com>

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 0acee9f..256969e 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -4834,8 +4834,10 @@ static int tg3_chip_reset(struct tg3 *tp)
 	 * sharing or irqpoll.
 	 */
 	tp->tg3_flags |= TG3_FLAG_CHIP_RESETTING;
-	tp->hw_status->status = 0;
-	tp->hw_status->status_tag = 0;
+	if (tp->hw_status) {
+		tp->hw_status->status = 0;
+		tp->hw_status->status_tag = 0;
+	}
 	tp->last_tag = 0;
 	smp_mb();
 	synchronize_irq(tp->pdev->irq);




-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Linux 2.6.21-rc6, Linus Torvalds, (Thu Apr 5, 10:50 pm)
[2/3] 2.6.21-rc6: known regressions, Adrian Bunk, (Fri Apr 13, 8:38 pm)
[3/3] 2.6.21-rc6: known regressions, Adrian Bunk, (Fri Apr 13, 8:38 pm)
Re: [3/3] 2.6.21-rc6: known regressions, Jeff Chua, (Sun Apr 15, 1:15 pm)
Re: [3/3] 2.6.21-rc6: known regressions, Dave Jones, (Sat Apr 14, 3:40 am)
Re: [3/3] 2.6.21-rc6: known regressions, Tobias Doerffel, (Sat Apr 14, 3:24 am)
Re: [3/3] 2.6.21-rc6: known regressions, Antonino A. Daplas, (Fri Apr 13, 9:57 pm)
Re: [3/3] 2.6.21-rc6: known regressions, Marcus Better, (Sun Apr 15, 12:26 pm)
Re: [3/3] 2.6.21-rc6: known regressions, Antonino A. Daplas, (Sun Apr 15, 7:08 pm)
Re: [3/3] 2.6.21-rc6: known regressions, Marcus Better, (Mon Apr 16, 2:23 am)
Re: [3/3] 2.6.21-rc6: known regressions, Antonino A. Daplas, (Mon Apr 16, 2:45 am)
Re: [3/3] 2.6.21-rc6: known regressions, Marcus Better, (Tue Apr 17, 4:17 am)
Re: [3/3] 2.6.21-rc6: known regressions, Pavel Machek, (Tue Apr 24, 11:33 am)
Re: [3/3] 2.6.21-rc6: known regressions, Antonino A. Daplas, (Tue Apr 17, 5:27 am)
Re: [3/3] 2.6.21-rc6: known regressions, Marcus Better, (Tue Apr 17, 7:54 am)
[1/3] 2.6.21-rc6: known regressions, Adrian Bunk, (Fri Apr 13, 8:36 pm)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Fri Apr 13, 5:29 pm)
Re: Linux 2.6.21-rc6, Adrian Bunk, (Fri Apr 13, 7:50 pm)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sat Apr 14, 8:09 am)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sat Apr 14, 8:24 am)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sat Apr 14, 8:31 am)
Re: Linux 2.6.21-rc6, Adrian Bunk, (Sat Apr 14, 9:00 am)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sat Apr 14, 2:28 pm)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sat Apr 14, 3:56 pm)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sat Apr 14, 4:23 pm)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sat Apr 14, 5:35 pm)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sat Apr 14, 5:58 pm)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sun Apr 15, 3:38 am)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sun Apr 15, 4:02 am)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sun Apr 15, 7:16 am)
Re: [linux-pm] Linux 2.6.21-rc6, David Brownell, (Sun Apr 15, 11:14 am)
Re: [linux-pm] Linux 2.6.21-rc6, Rafael J. Wysocki, (Sun Apr 15, 12:37 pm)
Re: [linux-pm] Linux 2.6.21-rc6, Tobias Diedrich, (Sun Apr 15, 3:40 pm)
Re: [linux-pm] Linux 2.6.21-rc6, Rafael J. Wysocki, (Sun Apr 15, 3:54 pm)
Re: [linux-pm] Linux 2.6.21-rc6, Tobias Diedrich, (Wed Apr 25, 1:14 pm)
Re: [linux-pm] Linux 2.6.21-rc6, Rafael J. Wysocki, (Wed Apr 25, 3:36 pm)
Re: [linux-pm] Linux 2.6.21-rc6, Tobias Diedrich, (Wed Apr 25, 4:09 pm)
Re: [linux-pm] Linux 2.6.21-rc6, David Brownell, (Sun Apr 15, 1:53 pm)
Re: Linux 2.6.21-rc6, Dmitry Torokhov, (Sun Apr 15, 10:19 am)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sun Apr 15, 11:52 am)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sun Apr 15, 2:50 pm)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sun Apr 15, 3:37 pm)
Re: Linux 2.6.21-rc6, Adrian Bunk, (Sat Apr 14, 4:25 pm)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sat Apr 14, 4:38 pm)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sat Apr 14, 4:16 am)
Re: Linux 2.6.21-rc6, Adrian Bunk, (Sat Apr 14, 8:26 am)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sat Apr 14, 5:05 am)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sat Apr 14, 6:32 am)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sat Apr 14, 2:50 am)
Re: Linux 2.6.21-rc6, Mattia Dongili, (Thu Apr 12, 11:14 am)
Re: Linux 2.6.21-rc6, Maxim Levitsky, (Thu Apr 12, 2:26 pm)
Re: Linux 2.6.21-rc6, Mattia Dongili, (Fri Apr 13, 4:52 am)
Re: Linux 2.6.21-rc6, Mattia Dongili, (Thu Apr 12, 1:02 pm)
Re: Linux 2.6.21-rc6, Jeff Chua, (Tue Apr 10, 10:35 am)
Re: Linux 2.6.21-rc6, Linus Torvalds, (Tue Apr 10, 11:35 am)
Re: Linux 2.6.21-rc6, Jeff Chua, (Thu Apr 12, 12:16 am)
Re: Linux 2.6.21-rc6, Andrew Morton, (Sun Apr 8, 7:09 pm)
Re: Linux 2.6.21-rc6, Dmitry Torokhov, (Mon Apr 9, 11:32 pm)
Re: Linux 2.6.21-rc6, Jeff Garzik, (Sun Apr 8, 8:59 pm)
Re: Linux 2.6.21-rc6, Chris Wedgwood, (Tue Apr 10, 3:57 am)
Re: Linux 2.6.21-rc6, Ingo Molnar, (Wed Apr 11, 3:38 am)
Re: Linux 2.6.21-rc6, Greg KH, (Sun Apr 8, 8:42 pm)
Re: Linux 2.6.21-rc6, Gene Heskett, (Sat Apr 7, 4:58 pm)
Re: Linux 2.6.21-rc6, Randy Dunlap, (Sat Apr 7, 2:37 pm)
Re: Linux 2.6.21-rc6, Linus Torvalds, (Sat Apr 7, 2:46 pm)
Re: Linux 2.6.21-rc6, Linus Torvalds, (Sat Apr 7, 2:51 pm)
Re: Linux 2.6.21-rc6, Randy Dunlap, (Sat Apr 7, 2:50 pm)
Re: Linux 2.6.21-rc6, Michal Piotrowski, (Sat Apr 7, 4:48 am)
Re: Linux 2.6.21-rc6 - regressions update, Soeren Sonnenburg, (Fri Apr 6, 6:44 pm)
Re: Linux 2.6.21-rc6 - regressions update, Linus Torvalds, (Fri Apr 6, 7:04 pm)
Re: Linux 2.6.21-rc6 - regressions update, Soeren Sonnenburg, (Sun Apr 8, 11:57 am)
[patch] high-res timers: UP resume fix, Ingo Molnar, (Sat Apr 7, 4:12 am)
[patch] high-res timers: resume fix, Ingo Molnar, (Sat Apr 7, 5:49 am)
Re: [patch] high-res timers: resume fix, Rafael J. Wysocki, (Sat Apr 7, 6:02 am)
[patch, take #3] high-res timers: resume fix, Ingo Molnar, (Sat Apr 7, 6:05 am)
Re: [patch, take #3] high-res timers: resume fix, Soeren Sonnenburg, (Sat Apr 7, 6:45 am)
Re: [patch] high-res timers: UP resume fix, Thomas Gleixner, (Sat Apr 7, 4:51 am)
Re: [patch] high-res timers: UP resume fix, Ingo Molnar, (Sat Apr 7, 4:25 am)
Re: [patch] high-res timers: UP resume fix, Thomas Gleixner, (Sat Apr 7, 4:48 am)
Re: [patch] high-res timers: UP resume fix, Rafael J. Wysocki, (Sat Apr 7, 5:48 am)
Re: [patch] high-res timers: UP resume fix, Pavel Machek, (Wed Apr 11, 10:00 am)
Re: [patch] high-res timers: UP resume fix, Ingo Molnar, (Sat Apr 7, 5:47 am)
Re: [patch] high-res timers: UP resume fix, Rafael J. Wysocki, (Sat Apr 7, 5:53 am)
Re: [patch] high-res timers: UP resume fix, Thomas Gleixner, (Sat Apr 7, 5:51 am)
Re: [patch] high-res timers: UP resume fix, Ingo Molnar, (Sat Apr 7, 4:50 am)
tg3: unable to handle null pointer dereference [Re: Linux 2...., Nishanth Aravamudan, (Fri Apr 6, 5:40 pm)
Re: tg3: unable to handle null pointer dereference [Re: Linu..., Michael Chan, (Fri Apr 6, 6:57 pm)
Re: tg3: unable to handle null pointer dereference, David Miller, (Fri Apr 6, 8:36 pm)
Re: tg3: unable to handle null pointer dereference, Nishanth Aravamudan, (Fri Apr 6, 9:53 pm)
speck-geostationary