Skip to contentSkip to conversation

fix oopsable net driver bug

PATCH New Jeff Garzik 1 participant 1 message Nov 23, 2003

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

PATCH 1/1 fix oopsable net driver bug

dev_kfree_skb, unlike kfree, will oops if passed NULL... and it might be passed NULL in this case, if skb_padto() returns NULL.

Linus, please do a

bk pull bk://gkernel.bkbits.net/net-drivers-2.5

This will update the following files:

 drivers/net/sis190.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

through these ChangeSets:

<[email protected]> (03/11/20 1.1478)
[netdrvr sis190] fix oopsable bug in TX path, related to skb_padto return

Caught by Francois Romieu.

drivers/net/sis190.c +2 -1
diff -Nru a/drivers/net/sis190.c b/drivers/net/sis190.c
@@ -949,7 +949,8 @@
 
 drop_tx:
 	tp->stats.tx_dropped++;
-	dev_kfree_skb(skb);
+	if (skb)
+		dev_kfree_skb(skb);
 	return 0;
 }