Skip to contentSkip to conversation

r8169: incorrect args to oob notify

PATCH In review Stephen Hemminger 2 participants 2 messages Feb 23, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 r8169: incorrect args to oob notify

Sparse detected this bug. The function oob_notify was being passed the private ptr, but expected to get the ioaddr. Compile checked only; not tested on real hardware.

Patch against net-next-2.6 but should be applied to net-2.6. Bug not present in 2.6.37 and earlier.

drivers/net/r8169.c +3 -2
@@ -617,8 +617,9 @@ static void ocp_write(struct rtl8169_pri
 	}
 }
 
-static void rtl8168_oob_notify(void __iomem *ioaddr, u8 cmd)
+static void rtl8168_oob_notify(struct rtl8169_private *tp, u8 cmd)
 {
+	void __iomem *ioaddr = tp->mmio_addr;
 	int i;
 
 	RTL_W8(ERIDR, cmd);
@@ -630,7 +631,7 @@ static void rtl8168_oob_notify(void __io
 			break;
 	}
 
-	ocp_write(ioaddr, 0x1, 0x30, 0x00000001);
+	ocp_write(tp, 0x1, 0x30, 0x00000001);
 }
 
 #define OOB_CMD_RESET		0x00
#1 lore raw

Stephen Hemminger <[email protected]> :
[...]

Quoted 6 lines

Sparse detected this bug. The function oob_notify was being passed the private ptr, but expected to get the ioaddr. Compile checked only; not tested on real hardware.

Patch against net-next-2.6 but should be applied to net-2.6. Bug not present in 2.6.37 and earlier.

Hayes has sent this fix and a few others. I am giving them a short testing right now.

Signature · 1 line
Ueimor