netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	kernel-janitors@vger.kernel.org, netdev@vger.kernel.org,
	intel-wired-lan@lists.osuosl.org,
	Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Alexander Lobakin <aleksander.lobakin@intel.com>,
	David Laight <David.Laight@aculab.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>, Jiri Pirko <jiri@resnulli.us>,
	Jonathan Cameron <jic23@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Lukasz Czapnik <lukasz.czapnik@intel.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com>,
	Dan Williams <dan.j.williams@intel.com>
Subject: Re: [PATCH net] ice: Fix freeing uninitialized pointers
Date: Fri, 22 Mar 2024 08:03:37 -0700	[thread overview]
Message-ID: <20240322080337.77a10cfd@kernel.org> (raw)
In-Reply-To: <82b49991-eb5a-7e8c-67e0-b0fd932f40b4@inria.fr>

On Fri, 22 Mar 2024 03:24:56 -0400 (EDT) Julia Lawall wrote:
> > 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 🤷️  
> 
> In my experiments with of_node_put, there seem to be many functions where
> removing the frees makes the function much more readable.  But
> kmalloc/kfree may be used in different contexts, where the management of
> the memory is a smaller percentage of the overall code.  So the tradeoffs
> may be different.

Good point! References are likely a very good use case for this sort
of thing. The act of bumping a counter lacks the feeling of lifetime
we get with an object :(

  reply	other threads:[~2024-03-22 15:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-16  9:44 [PATCH net] ice: Fix freeing uninitialized pointers Dan Carpenter
2024-03-18  7:58 ` Jiri Pirko
2024-03-18  8:10   ` Dan Carpenter
2024-03-19 19:43 ` Jakub Kicinski
2024-03-20  5:01   ` Dan Carpenter
2024-03-20  7:32     ` Julia Lawall
2024-03-20 16:33       ` Jonathan Cameron
2024-03-21  3:29     ` Jakub Kicinski
2024-03-21  9:59       ` Przemek Kitszel
2024-03-21 10:34         ` Dan Carpenter
2024-03-20 12:18 ` Markus Elfring
2024-03-21 17:59 ` Markus Elfring
2024-03-21 18:03   ` Andy Shevchenko
2024-03-21 18:14     ` Markus Elfring
2024-03-21 20:20       ` Julia Lawall
2024-03-21 22:27         ` Jesse Brandeburg
2024-03-22  1:48           ` Jakub Kicinski
2024-03-22  1:56             ` Jakub Kicinski
2024-03-22  7:24             ` Julia Lawall
2024-03-22 15:03               ` Jakub Kicinski [this message]
2024-03-22  5:30         ` Dan Carpenter
2024-03-22  8:48         ` Markus Elfring

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=20240322080337.77a10cfd@kernel.org \
    --to=kuba@kernel.org \
    --cc=David.Laight@aculab.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=dan.carpenter@linaro.org \
    --cc=dan.j.williams@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=himasekharx.reddy.pucha@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=jic23@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=julia.lawall@inria.fr \
    --cc=keescook@chromium.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukasz.czapnik@intel.com \
    --cc=maciej.fijalkowski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).