gpiolib: unlock on error in gpiod_set_debounce()
A message that is not in the archive (sent off-list or not yet received): 5225c32f.kWadywtP9mkLJ38j%[email protected]
PATCH 1/1 gpiolib: unlock on error in gpiod_set_debounce()
There is a missing unlock on error here.
Signed-off-by Dan Carpenter <[email protected]>
drivers/gpio/gpiolib.c +2 -1
@@ -1783,7 +1783,8 @@ static int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)if (!chip->set || !chip->set_debounce) {pr_warn ("%s: missing set() or set_debounce() operations\n" , __func__); -return -EIO ; + status = -EIO ; + goto fail; } status =gpio_ensure_requested (desc);
Quoted 9 lines · Dan Carpenter
There is a missing unlock on error here.
Signed-off-by Dan Carpenter <[email protected]>drivers/gpio/gpiolib.c +0
-0
drivers/gpio/gpiolib.c static int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce) · line 1788
Quoted 7 lines
drivers/gpio/gpiolib.c +2
-1@@ -1783,7 +1783,8 @@ static int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)if (!chip->set || !chip->set_debounce) {pr_warn ("%s: missing set() or set_debounce() operations\n" , __func__); -return -EIO ; + status = -EIO ; + goto fail; }
Yeah I screwed up. I queued another fix though, moving the locking below the check instead.
Yours,
Linus Walleij