summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Vecera <ivecera@redhat.com>2008-05-11 11:00:53 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2008-05-15 07:50:07 -0700
commit05d5b6cf37de1a9ceb873b770de113861a5b3df9 (patch)
tree0d5b012550caf712f1000f2c231ddfa10ed81927
parentfa5c104c2465470dc316bf211257f9e67e0ba602 (diff)
downloadlwn-05d5b6cf37de1a9ceb873b770de113861a5b3df9.tar.gz
lwn-05d5b6cf37de1a9ceb873b770de113861a5b3df9.zip
r8169: fix oops in r8169_get_mac_version
commit 21e197f231343201368338603cb0909a13961bac upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/net/r8169.c2
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)
SET_NETDEV_DEV(dev, &pdev->dev);
tp = netdev_priv(dev);
tp->dev = dev;
+ tp->pci_dev = pdev;
tp->msg_enable = netif_msg_init(debug.msg_enable, R8169_MSG_DEFAULT);
/* 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)
#endif
tp->intr_mask = 0xffff;
- tp->pci_dev = pdev;
tp->mmio_addr = ioaddr;
tp->align = cfg->align;
tp->hw_start = cfg->hw_start;