[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFBinCBT+8aFH68gKja7PS6BtPUBcEfW4KRv8GFyADiK_QB7dw@mail.gmail.com>
Date: Sat, 4 Oct 2025 21:52:34 +0200
From: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
To: Johan Hovold <johan@...nel.org>
Cc: Neil Armstrong <neil.armstrong@...aro.org>, Kevin Hilman <khilman@...libre.com>,
Jerome Brunet <jbrunet@...libre.com>, linux-amlogic@...ts.infradead.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Yu Kuai <yukuai3@...wei.com>, Markus.Elfring@....de
Subject: Re: [PATCH 1/2] soc: amlogic: canvas: fix device leak on lookup
On Fri, Sep 26, 2025 at 4:25 PM Johan Hovold <johan@...nel.org> wrote:
>
> Make sure to drop the reference taken to the canvas platform device when
> looking up its driver data.
>
> Note that holding a reference to a device does not prevent its driver
> data from going away so there is no point in keeping the reference.
>
> Also note that commit 28f851e6afa8 ("soc: amlogic: canvas: add missing
> put_device() call in meson_canvas_get()") fixed the leak in a lookup
> error path, but the reference is still leaking on success.
>
> Fixes: d4983983d987 ("soc: amlogic: add meson-canvas driver")
> Cc: stable@...r.kernel.org # 4.20: 28f851e6afa8
> Cc: Yu Kuai <yukuai3@...wei.com>
> Signed-off-by: Johan Hovold <johan@...nel.org>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
I haven't used the scope-based resource management myself as pointed
out by Markus.
That said, as far as I understand it's a feature in newer kernels and
this patch may be backported until 5.4 (oldest -stable kernel still
supported).
So let's go with this simple approach from Johan - we can still
improve this (without having to worry about backports).
Best regards,
Martin
Powered by blists - more mailing lists