aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xattr.c
diff options
context:
space:
mode:
authorAristeu Rozanski <aris@redhat.com>2012-09-12 10:31:13 -0400
committerTejun Heo <tj@kernel.org>2012-09-13 14:10:49 -0400
commitb9d6cfdeaf67cc34cdfd53ab234358dd2910a0f4 (patch)
tree15532d5a553ca1d3eec6caa15d8242ec3576d1d4 /fs/xattr.c
parent4895768b6aab55bbdbebcf2da090cb1a5ccf5463 (diff)
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>
Diffstat (limited to 'fs/xattr.c')
-rw-r--r--fs/xattr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xattr.c b/fs/xattr.c
index f053c1135d0..014f11321fd 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -845,7 +845,7 @@ static int __simple_xattr_set(struct simple_xattrs *xattrs, const char *name,
845 const void *value, size_t size, int flags) 845 const void *value, size_t size, int flags)
846{ 846{
847 struct simple_xattr *xattr; 847 struct simple_xattr *xattr;
848 struct simple_xattr *new_xattr = NULL; 848 struct simple_xattr *uninitialized_var(new_xattr);
849 int err = 0; 849 int err = 0;
850 850
851 /* value == NULL means remove */ 851 /* value == NULL means remove */