* [PATCH] Fix NULL pointer dereference on r8169 load
@ 2008-10-12 8:13 Petr Vandrovec
2008-10-13 3:58 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Petr Vandrovec @ 2008-10-12 8:13 UTC (permalink / raw)
To: ivecera; +Cc: romieu, davem, linux-kernel
From: Petr Vandrovec <petr@vandrovec.name>
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@vandrovec.name>
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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix NULL pointer dereference on r8169 load
2008-10-12 8:13 [PATCH] Fix NULL pointer dereference on r8169 load Petr Vandrovec
@ 2008-10-13 3:58 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-10-13 3:58 UTC (permalink / raw)
To: petr; +Cc: ivecera, romieu, linux-kernel
From: Petr Vandrovec <petr@vandrovec.name>
Date: Sun, 12 Oct 2008 10:13:52 +0200
> From: Petr Vandrovec <petr@vandrovec.name>
>
> 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@vandrovec.name>
Applied, thanks Petr.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-13 3:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-12 8:13 [PATCH] Fix NULL pointer dereference on r8169 load Petr Vandrovec
2008-10-13 3:58 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®