ieee1394/csr1212: fix false positive kmemcheck report
authorVegard Nossum <vegard.nossum@gmail.com>
Thu, 11 Sep 2008 18:59:03 +0000 (20:59 +0200)
committerVegard Nossum <vegard.nossum@gmail.com>
Mon, 15 Jun 2009 13:49:31 +0000 (15:49 +0200)
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 <vegard.nossum@gmail.com>
drivers/ieee1394/csr1212.c

index a6dfeb0b3372898cb7c4a59dd2604c71981edd92..e76cac64c53307852a442adac5264fe387c625e3 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <linux/errno.h>
 #include <linux/kernel.h>
+#include <linux/kmemcheck.h>
 #include <linux/string.h>
 #include <asm/bug.h>
 #include <asm/byteorder.h>
@@ -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);