mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Daniel Xu <dxu@dxuuu.xyz>,
	viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: kernel-team@fb.com
Subject: Re: [PATCH] xattr: NULL initialize name in simple_xattr_alloc
Date: Mon, 09 Mar 2020 12:30:07 -0700	[thread overview]
Message-ID: <19abedb11fae1b96aa052090e7a0d5bbea416824.camel@perches.com> (raw)
In-Reply-To: <20200309183719.3451-1-dxu@dxuuu.xyz>

On Mon, 2020-03-09 at 11:37 -0700, Daniel Xu wrote:
> It's preferable to initialize structs to a deterministic state.

Thanks Daniel.

> 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;


  reply	other threads:[~2020-03-09 19:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09 18:37 Daniel Xu
2020-03-09 19:30 ` Joe Perches [this message]
2020-03-09 22:31   ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19abedb11fae1b96aa052090e7a0d5bbea416824.camel@perches.com \
    --to=joe@perches.com \
    --cc=dxu@dxuuu.xyz \
    --cc=kernel-team@fb.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®