[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240321185640.6f7f4d6b@kernel.org>
Date: Thu, 21 Mar 2024 18:56:40 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Jesse Brandeburg <jesse.brandeburg@...el.com>
Cc: Julia Lawall <Julia.Lawall@...ia.fr>, Andy Shevchenko
<andriy.shevchenko@...ux.intel.com>, Dan Carpenter
<dan.carpenter@...aro.org>, <kernel-janitors@...r.kernel.org>,
<netdev@...r.kernel.org>, <intel-wired-lan@...ts.osuosl.org>, "Maciej
Fijalkowski" <maciej.fijalkowski@...el.com>, Przemek Kitszel
<przemyslaw.kitszel@...el.com>, Tony Nguyen <anthony.l.nguyen@...el.com>,
LKML <linux-kernel@...r.kernel.org>, Alexander Lobakin
<aleksander.lobakin@...el.com>, David Laight <David.Laight@...lab.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jiri Pirko <jiri@...nulli.us>, "Jonathan Cameron"
<jic23@...nel.org>, Kees Cook <keescook@...omium.org>, Lukasz Czapnik
<lukasz.czapnik@...el.com>, Paolo Abeni <pabeni@...hat.com>, "Pucha
Himasekhar Reddy" <himasekharx.reddy.pucha@...el.com>, Dan Williams
<dan.j.williams@...el.com>
Subject: Re: [PATCH net] ice: Fix freeing uninitialized pointers
On Thu, 21 Mar 2024 18:48:28 -0700 Jakub Kicinski wrote:
> On Thu, 21 Mar 2024 15:27:47 -0700 Jesse Brandeburg wrote:
> > The gist of it is that we should instead be using inline declarations,
> > which I also agree is a reasonable style for this. It more clearly shows
> > the __free(kfree) and the allocation (kzalloc, kcalloc, etc) on the same
> > (or virtually the same) line of code.
> >
> > I'm curious if Jakub would dislike this less? Accept?
>
> At present I find this construct unreadable.
> I may get used to it, hard to say.
>
> Also I don't see the benefit of the auto-freeing construct,
> I'd venture a guess that all the bugs it may prevent would
> have been caught by smatch. But I'm an old curmudgeon stuck
> in my ways. Feel free to experiment in Intel drivers, and we'll
> see how it works out 🤷️
On further reflection, yes, of all the bad options moving the
declarations inline in this particular case is probably the
least bad option.
Powered by blists - more mailing lists