public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: "Raphaël Gallais-Pou" <rgallaispou@gmail.com>
Cc: Markus Elfring <Markus.Elfring@web.de>,
	dri-devel@lists.freedesktop.org, stable@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Alain Volmat <alain.volmat@foss.st.com>,
	Benjamin Gaignard <benjamin.gaignard@collabora.com>,
	David Airlie <airlied@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Simona Vetter <simona@ffwll.ch>,
	Thomas Zimmermann <tzimmermann@suse.de>
Subject: Re: [PATCH] drm: sti: fix device leaks at component probe
Date: Tue, 4 Nov 2025 12:25:33 +0100	[thread overview]
Message-ID: <aQnirQ2d9qLqJ68i@hovoldconsulting.com> (raw)
In-Reply-To: <aQj69wzTceDklx2Y@thinkstation>

On Mon, Nov 03, 2025 at 07:56:55PM +0100, Raphaël Gallais-Pou wrote:

> diff --git i/drivers/gpu/drm/sti/sti_vtg.c w/drivers/gpu/drm/sti/sti_vtg.c
> index ee81691b3203..5193196d9291 100644
> --- i/drivers/gpu/drm/sti/sti_vtg.c
> +++ w/drivers/gpu/drm/sti/sti_vtg.c
> @@ -142,7 +142,7 @@ struct sti_vtg {
> 
>  struct sti_vtg *of_vtg_find(struct device_node *np)
>  {
> -       struct platform_device *pdev;
> +       struct platform_device *pdev __free(put_device) = NULL;

You'd need to declare the variable when looking up pdev, which is one of
the reasons I don't like the cleanup helpers. It also often makes the
code harder to reason about for no good reason (especially with some of
the more esoteric cleanup helpers).

Keep it simple.

Johan

  parent reply	other threads:[~2025-11-04 11:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-22 12:20 [PATCH] drm: sti: fix device leaks at component probe Johan Hovold
2025-09-22 16:16 ` Markus Elfring
2025-11-03 18:56   ` Raphaël Gallais-Pou
2025-11-04  8:00     ` Markus Elfring
2025-11-04 11:25     ` Johan Hovold [this message]
2025-10-27 13:35 ` Johan Hovold
2025-10-31 17:10 ` Raphaël Gallais-Pou
2025-11-04 11:21   ` Johan Hovold
2025-11-20 13:13     ` Johan Hovold
2025-11-24 13:27 ` Raphael Gallais-Pou

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=aQnirQ2d9qLqJ68i@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=Markus.Elfring@web.de \
    --cc=airlied@gmail.com \
    --cc=alain.volmat@foss.st.com \
    --cc=benjamin.gaignard@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=rgallaispou@gmail.com \
    --cc=simona@ffwll.ch \
    --cc=stable@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /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