projects
/
linux-2.6-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9e98c67
)
gpio: exar: add a check for the return value of ida_simple_get fails
author
Kangjie Lu
<kjlu@umn.edu>
Sat, 9 Mar 2019 04:07:57 +0000
(22:07 -0600)
committer
Bartosz Golaszewski
<bgolaszewski@baylibre.com>
Fri, 22 Mar 2019 15:48:39 +0000
(16:48 +0100)
ida_simple_get may fail and return a negative error number.
The fix checks its return value; if it fails, go to err_destroy.
Cc: <stable@vger.kernel.org>
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpio-exar.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/gpio/gpio-exar.c
b/drivers/gpio/gpio-exar.c
index 0ecd2369c2cad0daa5e08696ab85b91af5235a26..a09d2f9ebacc8d4909d79119333e344453ea6e0a 100644
(file)
--- 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;