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:
ea4a21a
)
gpio-sta2x11: Fix potential NULL pointer dereference
author
Sachin Kamat
<sachin.kamat@linaro.org>
Wed, 12 Jun 2013 04:02:45 +0000
(09:32 +0530)
committer
Linus Walleij
<linus.walleij@linaro.org>
Mon, 17 Jun 2013 08:26:34 +0000
(10:26 +0200)
devm_kzalloc can return NULL. Check for it before dereferencing.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-sta2x11.c
patch
|
blob
|
history
diff --git
a/drivers/gpio/gpio-sta2x11.c
b/drivers/gpio/gpio-sta2x11.c
index 558542552aae4a51590ff5e789c3db7ccb34ad89..9b5564564bcd73c55a6cd8094073f2c0b8226603 100644
(file)
--- a/
drivers/gpio/gpio-sta2x11.c
+++ b/
drivers/gpio/gpio-sta2x11.c
@@
-371,6
+371,8
@@
static int gsta_probe(struct platform_device *dev)
res = platform_get_resource(dev, IORESOURCE_MEM, 0);
chip = devm_kzalloc(&dev->dev, sizeof(*chip), GFP_KERNEL);
+ if (!chip)
+ return -ENOMEM;
chip->dev = &dev->dev;
chip->reg_base = devm_request_and_ioremap(&dev->dev, res);