Re: [PATCH] gpio: don't free unallocated ida on gpiochip_add_data_with_key() error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 2, 2018 at 2:39 PM Vladimir Zapolskiy <vz@xxxxxxxxx> wrote:

> The change corrects the error path in gpiochip_add_data_with_key()
> by avoiding to call ida_simple_remove(), if ida_simple_get() returns
> an error.
>
> Note that ida_simple_remove()/ida_free() throws a BUG(), if id argument
> is negative, it allows to easily check the correctness of the fix by
> fuzzing the return value from ida_simple_get().
>
> Fixes: ff2b13592299 ("gpio: make the gpiochip a real device")
> Cc: stable@xxxxxxxxxxxxxxx # v4.6+
> Signed-off-by: Vladimir Zapolskiy <vz@xxxxxxxxx>

Patch applied for fixes!

Good find Vladimir, thanks a lot.

Yours,
Linus Walleij



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux