projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ba3e217
)
gpio: tb10x: Handle return value of devm_kasprintf
author
Arvind Yadav
<arvind.yadav.cs@gmail.com>
Wed, 20 Sep 2017 07:13:09 +0000
(12:43 +0530)
committer
Linus Walleij
<linus.walleij@linaro.org>
Thu, 21 Sep 2017 12:14:17 +0000
(14:14 +0200)
devm_kasprintf() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-tb10x.c
patch
|
blob
|
history
diff --git
a/drivers/gpio/gpio-tb10x.c
b/drivers/gpio/gpio-tb10x.c
index 091ffaaec635411e6665e78991ed2faef75b3b7c..ac6f2a9841e53d332bec27e8d7bc64c0903288ff 100644
(file)
--- a/
drivers/gpio/gpio-tb10x.c
+++ b/
drivers/gpio/gpio-tb10x.c
@@
-193,6
+193,9
@@
static int tb10x_gpio_probe(struct platform_device *pdev)
tb10x_gpio->gc.label =
devm_kasprintf(&pdev->dev, GFP_KERNEL, "%pOF", pdev->dev.of_node);
+ if (!tb10x_gpio->gc.label)
+ return -ENOMEM;
+
tb10x_gpio->gc.parent = &pdev->dev;
tb10x_gpio->gc.owner = THIS_MODULE;
tb10x_gpio->gc.direction_input = tb10x_gpio_direction_in;