Commit 3e089d9f authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Linus Walleij

gpio: pisosr: add missing unlock

If spi_read() fails then we just returned but we missed unlocking the
mutex.
Signed-off-by: default avatarSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 8cae5f97
...@@ -53,12 +53,10 @@ static int pisosr_gpio_refresh(struct pisosr_gpio *gpio) ...@@ -53,12 +53,10 @@ static int pisosr_gpio_refresh(struct pisosr_gpio *gpio)
} }
ret = spi_read(gpio->spi, gpio->buffer, gpio->buffer_size); ret = spi_read(gpio->spi, gpio->buffer, gpio->buffer_size);
if (ret)
return ret;
mutex_unlock(&gpio->lock); mutex_unlock(&gpio->lock);
return 0; return ret;
} }
static int pisosr_gpio_get_direction(struct gpio_chip *chip, static int pisosr_gpio_get_direction(struct gpio_chip *chip,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment