xattr: mark variable as uninitialized to make both gcc and smatch happy
authorAristeu Rozanski <aris@redhat.com>
Wed, 12 Sep 2012 14:31:13 +0000 (10:31 -0400)
committerTejun Heo <tj@kernel.org>
Thu, 13 Sep 2012 18:10:49 +0000 (11:10 -0700)
commitb9d6cfdeaf67cc34cdfd53ab234358dd2910a0f4
tree15532d5a553ca1d3eec6caa15d8242ec3576d1d4
parent4895768b6aab55bbdbebcf2da090cb1a5ccf5463
xattr: mark variable as uninitialized to make both gcc and smatch happy

new_xattr in __simple_xattr_set() is only initialized with a valid
pointer if value is not NULL, which only happens if this function is
called directly with the intention to remove an existing extended
attribute. Even being safe to be this way, smatch warns about possible
NULL dereference. Dan Carpenter suggested using uninitialized_var()
which will make both gcc and smatch happy.

Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
fs/xattr.c