aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorVegard Nossum <vegard.nossum@gmail.com>2008-08-30 12:16:35 +0200
committerVegard Nossum <vegard.nossum@gmail.com>2009-06-15 15:49:25 +0200
commitfe55f6d5c0cfec4a710ef6ff63f162b99d5f7842 (patch)
tree4c4f0960d7355647e67f62e30e10c9215c123b65 /net
parentfc7d0c9f2122e8bf58deaf1252b0e750df5b0e91 (diff)
net: use kmemcheck bitfields API for skbuff
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Diffstat (limited to 'net')
-rw-r--r--net/core/skbuff.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index c2e4fb8f354..f0c4c6ad774 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -39,6 +39,7 @@
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
+#include <linux/kmemcheck.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/in.h>
@@ -201,6 +202,8 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
skb->data = data;
skb_reset_tail_pointer(skb);
skb->end = skb->tail + size;
+ kmemcheck_annotate_bitfield(skb, flags1);
+ kmemcheck_annotate_bitfield(skb, flags2);
/* make sure we initialize shinfo sequentially */
shinfo = skb_shinfo(skb);
atomic_set(&shinfo->dataref, 1);
@@ -217,6 +220,8 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
struct sk_buff *child = skb + 1;
atomic_t *fclone_ref = (atomic_t *) (child + 1);
+ kmemcheck_annotate_bitfield(child, flags1);
+ kmemcheck_annotate_bitfield(child, flags2);
skb->fclone = SKB_FCLONE_ORIG;
atomic_set(fclone_ref, 1);
@@ -633,6 +638,9 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask)
n = kmem_cache_alloc(skbuff_head_cache, gfp_mask);
if (!n)
return NULL;
+
+ kmemcheck_annotate_bitfield(n, flags1);
+ kmemcheck_annotate_bitfield(n, flags2);
n->fclone = SKB_FCLONE_UNAVAILABLE;
}