OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b45a02e
)
gpio: aspeed: fix a potential NULL pointer dereference
author
Kangjie Lu
<kjlu@umn.edu>
Sun, 24 Mar 2019 23:10:02 +0000
(18:10 -0500)
committer
Bartosz Golaszewski
<bgolaszewski@baylibre.com>
Mon, 25 Mar 2019 08:26:48 +0000
(09:26 +0100)
In case devm_kzalloc, the patch returns ENOMEM to avoid potential
NULL pointer dereference.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpio-aspeed.c
patch
|
blob
|
history
diff --git
a/drivers/gpio/gpio-aspeed.c
b/drivers/gpio/gpio-aspeed.c
index
854bce4
..
2175070
100644
(file)
--- a/
drivers/gpio/gpio-aspeed.c
+++ b/
drivers/gpio/gpio-aspeed.c
@@
-1224,6
+1224,8
@@
static int __init aspeed_gpio_probe(struct platform_device *pdev)
gpio->offset_timer =
devm_kzalloc(&pdev->dev, gpio->chip.ngpio, GFP_KERNEL);
+ if (!gpio->offset_timer)
+ return -ENOMEM;
return aspeed_gpio_setup_irqs(gpio, pdev);
}