Skip to content

Commit

Permalink
[TG3]: Fix crash during tg3_init_one().
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael Chan authored and David S. Miller committed Apr 7, 2007
1 parent 161980f commit b8fa2f3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b8fa2f3

Please sign in to comment.