]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.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)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:52:33 +0000 (19:52 -0600)
commitc251b12fab611548d9640792de031c95f646aa2f
tree081a874e5302aba47f4748d77dfacb1e2376ee6b
parent84cc0320dbd49b14cd4e61f56e3789b0ce58ab9f
gpiolib: Free the last requested descriptor

BugLink: https://bugs.launchpad.net/bugs/1836426
commit 19a4fbffc94e41abaa2a623a25ce2641d69eccf0 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/gpio/gpiolib.c