public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Petko Manolov <petko.manolov@konsulko.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Paolo Abeni <pabeni@redhat.com>,
	davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] net: usb: pegasus: fix memory leak on usb_submit_urb() failure
Date: Tue, 6 Jan 2026 11:15:32 +0200	[thread overview]
Message-ID: <20260106091532.GA4723@cabron.k.g> (raw)
In-Reply-To: <38d73c63-7521-41ad-8d4d-03d5ba2288df@lunn.ch>

On 26-01-02 23:02:53, Andrew Lunn wrote:
> > Sure, will do.  However, my v2 patch makes use of __free() cleanup
> > functionality, which in turn only applies back to v6.6 stable kernels.
> 
> I would suggest not using the magical __free() cleanup.
> 
> https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#using-device-managed-and-cleanup-h-constructs
> 
>     Low level cleanup constructs (such as __free()) can be used when
>     building APIs and helpers, especially scoped iterators. However,
>     direct use of __free() within networking core and drivers is
>     discouraged. Similar guidance applies to declaring variables
>     mid-function.


Heh, __free() is OK for APIs, but not drivers...

Maybe this text is a relic from the times auto cleanup was not fully understood?


		Petko

      reply	other threads:[~2026-01-06  9:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16 18:41 [PATCH] net: usb: pegasus: fix memory leak on usb_submit_urb() failure Petko Manolov
2025-12-16 18:43 ` kernel test robot
2025-12-23 11:44 ` Paolo Abeni
2026-01-02 12:10   ` Petko Manolov
2026-01-02 22:02     ` Andrew Lunn
2026-01-06  9:15       ` Petko Manolov [this message]

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=20260106091532.GA4723@cabron.k.g \
    --to=petko.manolov@konsulko.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    /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