[patch] fix networking memory leak in current -bk

From: Andrew Morton
Date: Sat Oct 04 2003 - 02:35:42 EST



Quicky fix for a horrid skb data leak...


net/core/dev.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)

diff -puN net/core/dev.c~skb-leak-fix net/core/dev.c
--- 25/net/core/dev.c~skb-leak-fix 2003-10-04 00:32:19.000000000 -0700
+++ 25-akpm/net/core/dev.c 2003-10-04 00:33:18.000000000 -0700
@@ -1576,9 +1576,13 @@ int netif_receive_skb(struct sk_buff *sk
}
}

- if (pt_prev)
- ret = deliver_skb(skb, pt_prev, 1);
- else {
+ if (pt_prev) {
+ if (!pt_prev->data) {
+ ret = deliver_to_old_ones(pt_prev, skb, 1);
+ } else {
+ ret = pt_prev->func(skb, skb->dev, pt_prev);
+ }
+ } else {
kfree_skb(skb);
/* Jamal, now you will not able to escape explaining
* me how you were going to use this. :-)

_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/