[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aQnirQ2d9qLqJ68i@hovoldconsulting.com>
Date: Tue, 4 Nov 2025 12:25:33 +0100
From: Johan Hovold <johan@...nel.org>
To: Raphaël Gallais-Pou <rgallaispou@...il.com>
Cc: Markus Elfring <Markus.Elfring@....de>, dri-devel@...ts.freedesktop.org,
stable@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
Alain Volmat <alain.volmat@...s.st.com>,
Benjamin Gaignard <benjamin.gaignard@...labora.com>,
David Airlie <airlied@...il.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Simona Vetter <simona@...ll.ch>,
Thomas Zimmermann <tzimmermann@...e.de>
Subject: Re: [PATCH] drm: sti: fix device leaks at component probe
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
Powered by blists - more mailing lists