Re: [NET][r8169 regression] Linux "v2.6.27-2721-gfd04808" panicson boot - reverting commit 7bf6bf4803df1adc927f585168d2135fb019c698 fixesit

From: David Miller
Date: Sun Oct 12 2008 - 23:59:59 EST


From: Plamen Petrov <pvp-lsts@xxxxxxxxxxxxx>
Date: Sun, 12 Oct 2008 22:17:37 +0300

> Hello!
>
> The latest stable snapshot of Linus' tree panics during boot for me.
> "git describe" says "v2.6.27-2721-gfd04808".
> I was only able to take a picture of the panic with my phone camera,
> see [1] and [2] (sorry for the awful quality).
> After looking around, I marked a few commits, and I think I got lucky -
> reverted the first one, and my machine booted up normally.
> The commit I reverted is :

This is fixed by the following patch by Petr:

r8169: NULL pointer dereference on r8169 load

mmio_addr in r8169 needs to be initialized before use

Maybe that all tp-> initialization should be moved before rtl_init_mac_address call,
but this is enough to get rid of crash in rtl_rar_set due to mmio_addr being uninitialized.

Signed-off-by: Petr Vandrovec <petr@xxxxxxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
---
drivers/net/r8169.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index bdae2c5..c821da2 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2154,6 +2154,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)

spin_lock_init(&tp->lock);

+ tp->mmio_addr = ioaddr;
+
rtl_init_mac_address(tp, ioaddr);

/* Get MAC address */
@@ -2186,7 +2188,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
#endif

tp->intr_mask = 0xffff;
- tp->mmio_addr = ioaddr;
tp->align = cfg->align;
tp->hw_start = cfg->hw_start;
tp->intr_event = cfg->intr_event;
--
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/