[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200309223145.GI23230@ZenIV.linux.org.uk>
Date: Mon, 9 Mar 2020 22:31:45 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Joe Perches <joe@...ches.com>
Cc: Daniel Xu <dxu@...uu.xyz>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-team@...com
Subject: Re: [PATCH] xattr: NULL initialize name in simple_xattr_alloc
On Mon, Mar 09, 2020 at 12:30:07PM -0700, Joe Perches wrote:
> On Mon, 2020-03-09 at 11:37 -0700, Daniel Xu wrote:
> > It's preferable to initialize structs to a deterministic state.
>
> Thanks Daniel.
Not much point, TBH - there are only two callers, both assigning
that field very shortly. If you want to do it, do it right -
make that
simple_xattr_alloc(name, value, len)
with kfree(name) done on failure. And make the callers allocate
the name first. Simpler cleanup rules on failure exits that
way...
Powered by blists - more mailing lists