OSDN Git Service
(root)
/
android-x86
/
kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fd975a7
)
gpio: xgene: Prevent NULL pointer dereference
author
Axel Lin
<axel.lin@ingics.com>
Mon, 21 Mar 2016 12:03:50 +0000
(20:03 +0800)
committer
Linus Walleij
<linus.walleij@linaro.org>
Wed, 30 Mar 2016 08:39:39 +0000
(10:39 +0200)
platform_get_resource() can return NULL, thus add NULL test to prevent NULL
pointer dereference.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-xgene.c
patch
|
blob
|
history
diff --git
a/drivers/gpio/gpio-xgene.c
b/drivers/gpio/gpio-xgene.c
index
c0aa387
..
0dc9161
100644
(file)
--- a/
drivers/gpio/gpio-xgene.c
+++ b/
drivers/gpio/gpio-xgene.c
@@
-173,6
+173,11
@@
static int xgene_gpio_probe(struct platform_device *pdev)
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ err = -EINVAL;
+ goto err;
+ }
+
gpio->base = devm_ioremap_nocache(&pdev->dev, res->start,
resource_size(res));
if (!gpio->base) {