diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-04-26 06:18:00 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-04-26 06:18:00 -0400 |
commit | 45de6fd958d7f407bdb5fdc6914b3262519d891c (patch) | |
tree | c1b9f9023e93d0f28f773ca4be41d107f79cd600 /net/core | |
parent | 1f5d5dbf0372dd933d8325054889ba09d996e50b (diff) | |
parent | 3b908870b8332dfd40be0e919e187aa4991536fb (diff) |
Merge branch 'upstream-fixes' into upstream
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/skbuff.c | 8 | ||||
-rw-r--r-- | net/core/stream.c | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 09464fa8d72..fb3770f9c09 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -112,6 +112,14 @@ void skb_under_panic(struct sk_buff *skb, int sz, void *here) BUG(); } +void skb_truesize_bug(struct sk_buff *skb) +{ + printk(KERN_ERR "SKB BUG: Invalid truesize (%u) " + "len=%u, sizeof(sk_buff)=%Zd\n", + skb->truesize, skb->len, sizeof(struct sk_buff)); +} +EXPORT_SYMBOL(skb_truesize_bug); + /* Allocate a new skbuff. We do this ourselves so we can fill in a few * 'private' fields and also do memory statistics to find all the * [BEEP] leaks. diff --git a/net/core/stream.c b/net/core/stream.c index 35e25259fd9..e9489696f69 100644 --- a/net/core/stream.c +++ b/net/core/stream.c @@ -176,6 +176,7 @@ void sk_stream_rfree(struct sk_buff *skb) { struct sock *sk = skb->sk; + skb_truesize_check(skb); atomic_sub(skb->truesize, &sk->sk_rmem_alloc); sk->sk_forward_alloc += skb->truesize; } |