Re: [PATCH] gpio: sim: fix a memory leak

From: Bartosz Golaszewski
Date: Thu Feb 16 2023 - 09:49:57 EST


On Thu, Feb 16, 2023 at 3:42 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> On Thu, Feb 16, 2023 at 03:15:55PM +0100, Bartosz Golaszewski wrote:
> > Fix an inverted logic bug in gpio_sim_remove_hogs() that leads to GPIO
> > hog structures never being freed.
>
> Ha-ha, I stared to this code, and in the head I was "okay, this loop is until
> chip_label is *not* NULL, so should be fine".
>
> At the same time, "! is hard to process", see for example
> 2754435d4c82 ("ACPI / battery: get rid of negations in conditions")
> which I had suggested.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
>
> P.S. But my patch I mentioned looks also good to have, no?
>

I don't think it matters. In fact - I'm not sure if the order was
accidental or not anymore. :( If you want to discuss it further -
please resend it as a regular patch on the list.

Bart