diff options
author | Petr Vandrovec <petr@vandrovec.name> | 2008-10-12 23:58:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-12 23:58:29 -0400 |
commit | 738e1e694bf6d9e965ba0ce2667a1bec5780a172 (patch) | |
tree | 803330370e1127554c5c2f3e1e821c4afdd6b86e /drivers/net | |
parent | f3073ac76755abd63b1d4c3d145f4c15b65b5355 (diff) |
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@vandrovec.name>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | 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 bdae2c59a750..c821da21d8eb 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) | |||
2154 | 2154 | ||
2155 | spin_lock_init(&tp->lock); | 2155 | spin_lock_init(&tp->lock); |
2156 | 2156 | ||
2157 | tp->mmio_addr = ioaddr; | ||
2158 | |||
2157 | rtl_init_mac_address(tp, ioaddr); | 2159 | rtl_init_mac_address(tp, ioaddr); |
2158 | 2160 | ||
2159 | /* Get MAC address */ | 2161 | /* Get MAC address */ |
@@ -2186,7 +2188,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2186 | #endif | 2188 | #endif |
2187 | 2189 | ||
2188 | tp->intr_mask = 0xffff; | 2190 | tp->intr_mask = 0xffff; |
2189 | tp->mmio_addr = ioaddr; | ||
2190 | tp->align = cfg->align; | 2191 | tp->align = cfg->align; |
2191 | tp->hw_start = cfg->hw_start; | 2192 | tp->hw_start = cfg->hw_start; |
2192 | tp->intr_event = cfg->intr_event; | 2193 | tp->intr_event = cfg->intr_event; |