linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xattr: NULL initialize name in simple_xattr_alloc
@ 2020-03-09 18:37 Daniel Xu
  2020-03-09 19:30 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Xu @ 2020-03-09 18:37 UTC (permalink / raw)
  To: viro, linux-fsdevel, linux-kernel; +Cc: Daniel Xu, joe, kernel-team

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

Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-09 22:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-09 18:37 [PATCH] xattr: NULL initialize name in simple_xattr_alloc Daniel Xu
2020-03-09 19:30 ` Joe Perches
2020-03-09 22:31   ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).