Re: [PATCH] spi: fix use-after-free on managed registration failure

From: Johan Hovold

Date: Fri Mar 27 2026 - 04:48:43 EST


On Fri, Mar 27, 2026 at 09:20:08AM +0200, Andy Shevchenko wrote:
> On Thu, Mar 26, 2026 at 07:25:14PM +0000, Mark Brown wrote:
> > On Thu, Mar 26, 2026 at 09:19:22PM +0200, Andy Shevchenko wrote:
> > > On Thu, Mar 26, 2026 at 11:35:56AM +0200, Andy Shevchenko wrote:
> > > > On Wed, Mar 25, 2026 at 03:53:19PM +0100, Johan Hovold wrote:
>
> ...
>
> > > > > An alternative would be a partial revert of the offending commit, but
> > > > > it is better to handle this explicitly until the API has been fixed
> > > > > (e.g. see 5e844cc37a5c ("spi: Introduce device-managed SPI controller
> > > > > allocation")).
> >
> > > > Acked-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> >
> > > Seems Mark dropped the original change, so this is not needed.
> >
> > Not intentionally?
>
> I don't know, but it allows to start from fixing the users to avoid regressions.
> I'm fine with the current state of affairs.

The offending commit is already in mainline and hasn't been reverted in
Mark's tree. This fix has been merged there though so nothing more is
needed for now.

Johan