projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
853f0cb
)
gpio: palmas: fix a possible NULL dereference
author
LABBE Corentin
<clabbe.montjoie@gmail.com>
Wed, 11 Nov 2015 20:27:36 +0000
(21:27 +0100)
committer
Linus Walleij
<linus.walleij@linaro.org>
Tue, 17 Nov 2015 13:40:24 +0000
(14:40 +0100)
of_match_device could return NULL, and so cause a NULL pointer
dereference later.
Reported-by: coverity (CID 1130700)
Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-palmas.c
patch
|
blob
|
history
diff --git
a/drivers/gpio/gpio-palmas.c
b/drivers/gpio/gpio-palmas.c
index 171a6389f9ce086ffdf74f6c50523a77e205b473..52b447c071cbaa2e160bf5a67fc511ae26d6a55d 100644
(file)
--- a/
drivers/gpio/gpio-palmas.c
+++ b/
drivers/gpio/gpio-palmas.c
@@
-167,6
+167,8
@@
static int palmas_gpio_probe(struct platform_device *pdev)
const struct palmas_device_data *dev_data;
match = of_match_device(of_palmas_gpio_match, &pdev->dev);
+ if (!match)
+ return -ENODEV;
dev_data = match->data;
if (!dev_data)
dev_data = &palmas_dev_data;