]> asedeno.scripts.mit.edu Git - linux.git/commit
gpiolib: Free the last requested descriptor
authorRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Thu, 13 Sep 2018 13:37:04 +0000 (15:37 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 18 Sep 2018 23:36:05 +0000 (16:36 -0700)
commit19a4fbffc94e41abaa2a623a25ce2641d69eccf0
tree1d10c1d95a029af42fe32263a8306e143e845a3c
parent7876320f88802b22d4e2daf7eb027dd14175a0f8
gpiolib: Free the last requested descriptor

The current code only frees N-1 gpios if an error occurs during
gpiod_set_transitory, gpiod_direction_output or gpiod_direction_input.
Leading to gpios that cannot be used by userspace nor other drivers.

Cc: Timur Tabi <timur@codeaurora.org>
Cc: stable@vger.kernel.org
Fixes: ab3dbcf78f60f46d ("gpioib: do not free unrequested descriptors)
Reported-by: Jan Lorenzen <jl@newtec.dk>
Reported-by: Jim Paris <jim@jtan.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c