Re: [PATCH 2/2] gpio: fix cleanup path on hog failure

From: Bartosz Golaszewski

Date: Tue Jun 09 2026 - 10:54:34 EST


On Tue, Jun 9, 2026 at 4:25 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> On Tue, Jun 09, 2026 at 02:17:50PM +0200, Bartosz Golaszewski wrote:
> > If gpiochip_hog_lines() successfully processes some hogs but fails on
> > a later one, the error handling path in gpiochip_add_data_with_key()
> > jumps directly to err_remove_of_chip. This leaks resources allocated
> > earlier for ACPI, interrupts and hogs that were successfully processed.
> > Use the right label in error path.
>
> This seems legit, but there is still a problem with implementation of
> gpiochip_hog_lines(). Ideally it should clean up the crap it left when it
> poops. With that, this one will require a brand new label just before
> acpi_gpiochip_remove().
>
> --
> With Best Regards,
> Andy Shevchenko
>
>

Let's get this to stable and then rework it better in v7.2?

Bart