diff options
author | Ivan Vecera <ivecera@redhat.com> | 2008-04-17 16:48:41 -0400 |
---|---|---|
committer | Francois Romieu <romieu@fr.zoreil.com> | 2008-04-17 16:48:41 -0400 |
commit | 21e197f231343201368338603cb0909a13961bac (patch) | |
tree | 697b93be0ba9df2fbc481f72d7950b76be314ed1 /drivers/net/r8169.c | |
parent | cee60c377de6d9d10f0a2876794149bd79a15020 (diff) |
r8169: fix oops in r8169_get_mac_version
r8169_get_mac_version crashes when it meets an unknown MAC
due to tp->pci_dev not being set. Initialize it early.
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r-- | drivers/net/r8169.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 5e8ad634490f..657242504621 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -1617,6 +1617,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1617 | SET_NETDEV_DEV(dev, &pdev->dev); | 1617 | SET_NETDEV_DEV(dev, &pdev->dev); |
1618 | tp = netdev_priv(dev); | 1618 | tp = netdev_priv(dev); |
1619 | tp->dev = dev; | 1619 | tp->dev = dev; |
1620 | tp->pci_dev = pdev; | ||
1620 | tp->msg_enable = netif_msg_init(debug.msg_enable, R8169_MSG_DEFAULT); | 1621 | tp->msg_enable = netif_msg_init(debug.msg_enable, R8169_MSG_DEFAULT); |
1621 | 1622 | ||
1622 | /* enable device (incl. PCI PM wakeup and hotplug setup) */ | 1623 | /* enable device (incl. PCI PM wakeup and hotplug setup) */ |
@@ -1777,7 +1778,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1777 | #endif | 1778 | #endif |
1778 | 1779 | ||
1779 | tp->intr_mask = 0xffff; | 1780 | tp->intr_mask = 0xffff; |
1780 | tp->pci_dev = pdev; | ||
1781 | tp->mmio_addr = ioaddr; | 1781 | tp->mmio_addr = ioaddr; |
1782 | tp->align = cfg->align; | 1782 | tp->align = cfg->align; |
1783 | tp->hw_start = cfg->hw_start; | 1783 | tp->hw_start = cfg->hw_start; |