[PATCH] xattr: NULL initialize name in simple_xattr_alloc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It's preferable to initialize structs to a deterministic state.

Signed-off-by: Daniel Xu <dxu@xxxxxxxxx>
---
 fs/xattr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/xattr.c b/fs/xattr.c
index 90dd78f0eb27..92b324c265d2 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -821,6 +821,7 @@ struct simple_xattr *simple_xattr_alloc(const void *value, size_t size)
 	if (!new_xattr)
 		return NULL;
 
+	new_xattr->name = NULL;
 	new_xattr->size = size;
 	memcpy(new_xattr->value, value, size);
 	return new_xattr;
-- 
2.21.1




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux