Skip to contentSkip to conversation

(2/3) PPPoE fix oops on /proc/net/pppoe

PATCH New Stephen Hemminger 1 participant 1 message Jun 21, 2003

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

PATCH 1/1 (2/3) PPPoE fix oops on /proc/net/pppoe

Reading /proc/net/pppoe will OOPs because it calls hash_item() when the object pointer (po) is null.

drivers/net/pppoe.c +3 -2
diff -Nru a/drivers/net/pppoe.c b/drivers/net/pppoe.c
@@ -1015,8 +1015,9 @@
 		goto out;
 	}
 	po = v;
-	po = po->next;
-	if (!po) {
+	if (po->next) 
+		po = po->next;
+	else {
 		int hash = hash_item(po->pppoe_pa.sid, po->pppoe_pa.remote);
 
 		while (++hash < PPPOE_HASH_SIZE) {