From 004cdb5a718fa2bb697c541eb1171ee817fc72f1 Mon Sep 17 00:00:00 2001 From: Vegard Nossum Date: Wed, 10 Sep 2008 15:15:23 +0200 Subject: ieee1394: annotate bitfield Signed-off-by: Vegard Nossum --- drivers/ieee1394/nodemgr.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/ieee1394') diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index a6d55bebe61a..5122b5a8aa2d 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -39,7 +40,10 @@ struct nodemgr_csr_info { struct hpsb_host *host; nodeid_t nodeid; unsigned int generation; + + kmemcheck_bitfield_begin(flags); unsigned int speed_unverified:1; + kmemcheck_bitfield_end(flags); }; @@ -1293,6 +1297,7 @@ static void nodemgr_node_scan_one(struct hpsb_host *host, u8 *speed; ci = kmalloc(sizeof(*ci), GFP_KERNEL); + kmemcheck_annotate_bitfield(ci, flags); if (!ci) return; -- cgit v1.2.3 From 96c25c81ecf452b778e2f432bd17c95de637d129 Mon Sep 17 00:00:00 2001 From: Vegard Nossum Date: Thu, 11 Sep 2008 20:59:03 +0200 Subject: ieee1394/csr1212: fix false positive kmemcheck report kmemcheck reports a use of uninitialized memory here, but it's not a real error. The structure in question has just been allocated, and the whole field is initialized, but it happens in two steps. We fix the false positive by inserting a kmemcheck annotation. Signed-off-by: Vegard Nossum --- drivers/ieee1394/csr1212.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/ieee1394') diff --git a/drivers/ieee1394/csr1212.c b/drivers/ieee1394/csr1212.c index a6dfeb0b3372..e76cac64c533 100644 --- a/drivers/ieee1394/csr1212.c +++ b/drivers/ieee1394/csr1212.c @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -387,6 +388,7 @@ csr1212_new_descriptor_leaf(u8 dtype, u32 specifier_id, if (!kv) return NULL; + kmemcheck_annotate_variable(kv->value.leaf.data[0]); CSR1212_DESCRIPTOR_LEAF_SET_TYPE(kv, dtype); CSR1212_DESCRIPTOR_LEAF_SET_SPECIFIER_ID(kv, specifier_id); -- cgit v1.2.3