diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2019-03-23 07:25:00 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2019-03-23 07:25:00 +0100 |
commit | 3b55cb88c3898239ebbca86372ece1d145013010 (patch) | |
tree | 33a534d71b93b4ff9fc9173b87427b3ca32d5bc6 /drivers | |
parent | 9e98c678c2d6ae3a17cb2de55d17f69dddaa231b (diff) | |
parent | b45a02e13ee74b6fde56df4d76786058821a3aba (diff) | |
download | lwn-3b55cb88c3898239ebbca86372ece1d145013010.tar.gz lwn-3b55cb88c3898239ebbca86372ece1d145013010.zip |
Merge tag 'gpio-5.1-rc2-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into fixes
GPIO fixes for v5.1-rc2
- check the return value of a function that can fail in gpio-exar
- fix the SPDX identifier in amd-fch
- fix the direction_input callback in gpio-adnp
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpio/gpio-adnp.c | 6 | ||||
-rw-r--r-- | drivers/gpio/gpio-exar.c | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-adnp.c b/drivers/gpio/gpio-adnp.c index 91b90c0cea73..12acdac85820 100644 --- a/drivers/gpio/gpio-adnp.c +++ b/drivers/gpio/gpio-adnp.c @@ -132,8 +132,10 @@ static int adnp_gpio_direction_input(struct gpio_chip *chip, unsigned offset) if (err < 0) goto out; - if (err & BIT(pos)) - err = -EACCES; + if (value & BIT(pos)) { + err = -EPERM; + goto out; + } err = 0; diff --git a/drivers/gpio/gpio-exar.c b/drivers/gpio/gpio-exar.c index 0ecd2369c2ca..a09d2f9ebacc 100644 --- a/drivers/gpio/gpio-exar.c +++ b/drivers/gpio/gpio-exar.c @@ -148,6 +148,8 @@ static int gpio_exar_probe(struct platform_device *pdev) mutex_init(&exar_gpio->lock); index = ida_simple_get(&ida_index, 0, 0, GFP_KERNEL); + if (index < 0) + goto err_destroy; sprintf(exar_gpio->name, "exar_gpio%d", index); exar_gpio->gpio_chip.label = exar_gpio->name; |