From: "Michael Chan" <mchan@broadcom.com>
To: "Nishanth Aravamudan" <nacc@us.ibm.com>, davem@davemloft.net
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
"LKML" <linux-kernel@vger.kernel.org>,
netdev@vger.kernel.org
Subject: Re: tg3: unable to handle null pointer dereference [Re: Linux 2.6.21-rc6]
Date: Fri, 06 Apr 2007 15:57:13 -0700 [thread overview]
Message-ID: <1175900233.7911.87.camel@dell> (raw)
In-Reply-To: <20070406214014.GF3346@us.ibm.com>
On Fri, 2007-04-06 at 14:40 -0700, Nishanth Aravamudan wrote:
> 2.6.21-rc5 is ok. 2.6.21-rc6 results in
>
> [ 14.241665] Unable to handle kernel NULL pointer dereference (address 0000000000000000)
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);
next prev parent reply other threads:[~2007-04-06 22:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.64.0704051944230.6730@woody.linux-foundation.org>
2007-04-06 21:40 ` tg3: unable to handle null pointer dereference [Re: Linux 2.6.21-rc6] Nishanth Aravamudan
2007-04-06 22:57 ` Michael Chan [this message]
2007-04-07 0:36 ` tg3: unable to handle null pointer dereference David Miller
2007-04-07 1:53 ` Nishanth Aravamudan
2007-04-14 0:36 ` [1/3] 2.6.21-rc6: known regressions Adrian Bunk
2007-04-14 1:34 ` Linus Torvalds
2007-04-14 1:49 ` Brandeburg, Jesse
2007-04-14 4:25 ` David Miller
2007-04-14 5:07 ` Ian McDonald
2007-04-14 5:29 ` David Miller
2007-04-14 6:21 ` Ingo Molnar
2007-04-14 7:25 ` Greg KH
2007-04-20 13:39 ` Ingo Molnar
2007-04-20 13:46 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1175900233.7911.87.camel@dell \
--to=mchan@broadcom.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=nacc@us.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).