login
Header Space

 
 

[patch 30/37] r8169: fix oops in r8169_get_mac_version

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>, <stable@...>
Cc: Justin Forbes <jmforbes@...>, Zwane Mwaikambo <zwane@...>, Theodore Ts'o <tytso@...>, Randy Dunlap <rdunlap@...>, Dave Jones <davej@...>, Chuck Wolber <chuckw@...>, Chris Wedgwood <reviews@...>, Michael Krufky <mkrufky@...>, Chuck Ebbert <cebbert@...>, Domenico Andreoli <cavokz@...>, <torvalds@...>, <akpm@...>, <alan@...>, Ivan Vecera <ivecera@...>, Francois Romieu <romieu@...>
Date: Tuesday, May 13, 2008 - 4:12 pm

2.6.25-stable review patch.  If anyone has any objections, please let us
know.

------------------
From: Ivan Vecera <ivecera@redhat.com>

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>

---
 drivers/net/r8169.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1617,6 +1617,7 @@ rtl8169_init_one(struct pci_dev *pdev, c
 	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, c
 #endif
 
 	tp->intr_mask = 0xffff;
-	tp->pci_dev = pdev;
 	tp->mmio_addr = ioaddr;
 	tp->align = cfg->align;
 	tp->hw_start = cfg->hw_start;

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/37] 2.6.25.4 -stable review, Greg KH, (Tue May 13, 4:10 pm)
[patch 37/37] md: fix raid5 repair operations, Greg KH, (Tue May 13, 4:12 pm)
[patch 30/37] r8169: fix oops in r8169_get_mac_version, Greg KH, (Tue May 13, 4:12 pm)
[patch 24/37] sparc: Fix ptrace() detach., Greg KH, (Tue May 13, 4:12 pm)
Re: Hardware designt to prevent Damages... [WAS: [patch 23/3..., Michelle Konzack, (Fri May 16, 11:22 am)
Re: Hardware designt to prevent Damages... [WAS: [patch 23/3..., linux-os (Dick Johnson), (Thu May 15, 1:57 pm)
Re: [patch 22/37] x86: sysfs cpu?/topology is empty in 2.6.2..., Vaidyanathan Srinivasan, (Thu May 15, 2:06 pm)
Re: [patch 20/37] {nfnetlink, ip, ip6}_queue: fix skb_over_p..., Gustavo Guillermo Perez, (Wed May 14, 12:45 pm)
[patch 06/37] sparc: sunzilog uart order, Greg KH, (Tue May 13, 4:11 pm)
speck-geostationary