Re: [PATCH] mfd: intel-lpss: fix iDMA device leak on probe failure
From: Andy Shevchenko
Date: Tue Sep 22 2026 - 08:52:10 EST
On Tue, Sep 22, 2026 at 03:59:32PM +0800, Guangshuo Li wrote:
> On Mon, 21 Sept 2026 at 19:05, Mika Westerberg
> <mika.westerberg@xxxxxxxxxxxxxxx> wrote:
> > On Mon, Sep 21, 2026 at 06:40:58PM +0800, Guangshuo Li wrote:
> > I think this could use devm_mfd_add_devices() instead.
> >
> > > The issue was identified by a static analysis tool I developed and
> > > confirmed by manual review.
> Do you mean converting both MFD registrations to devm_mfd_add_devices()
> and dropping the explicit mfd_remove_devices() from the remove path, like
> this?
Won't work properly. The rule of thumb, it should be no 'goto' after devm_*() call.
> Would this be the preferred change?
--
With Best Regards,
Andy Shevchenko