Skip to content

Commit

Permalink
ieee1394/csr1212: fix false positive kmemcheck report
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vegard Nossum committed Jun 15, 2009
1 parent 004cdb5 commit 96c25c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/ieee1394/csr1212.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 96c25c8

Please sign in to comment.