lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251029160921.GP760669@ziepe.ca>
Date: Wed, 29 Oct 2025 13:09:21 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Pasha Tatashin <pasha.tatashin@...een.com>
Cc: David Matlack <dmatlack@...gle.com>, akpm@...ux-foundation.org,
	brauner@...nel.org, corbet@....net, graf@...zon.com,
	linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
	linux-mm@...ck.org, masahiroy@...nel.org, ojeda@...nel.org,
	pratyush@...nel.org, rdunlap@...radead.org, rppt@...nel.org,
	tj@...nel.org, jasonmiu@...gle.com, skhawaja@...gle.com
Subject: Re: [PATCH v3 1/3] liveupdate: kho: warn and fail on metadata or
 preserved memory in scratch area

On Mon, Oct 27, 2025 at 08:01:59PM -0400, Pasha Tatashin wrote:
> > >  static void *xa_load_or_alloc(struct xarray *xa, unsigned long index, size_t sz)
> > >  {
> > > -       void *elm, *res;
> > > +       void *res = xa_load(xa, index);
> > >
> > > -       elm = xa_load(xa, index);
> > > -       if (elm)
> > > -               return elm;
> > > +       if (res)
> > > +               return res;
> > > +
> > > +       void *elm __free(kfree) = kzalloc(sz, GFP_KERNEL);
> >
> > nit: This breaks the local style of always declaring variables at the
> > beginning of blocks.
> 
> I think this suggestion came from Mike, to me it looks alright, as it
> is only part of the clean-up path.

It is the recommended style for using cleanup.h stuff, declare and
assign in one statement.

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ