projects
/
kernel
/
kernel-generic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8477ced
)
gpio-charger: Check result of kzalloc
author
Lars-Peter Clausen
<lars@metafoo.de>
Thu, 18 Nov 2010 22:08:37 +0000
(23:08 +0100)
committer
Anton Vorontsov
<cbouatmailru@gmail.com>
Tue, 21 Dec 2010 23:27:30 +0000
(
02:27
+0300)
Since kzalloc can return NULL we have to check its result.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
drivers/power/gpio-charger.c
patch
|
blob
|
history
diff --git
a/drivers/power/gpio-charger.c
b/drivers/power/gpio-charger.c
index
fccbe99
..
8458caf
100644
(file)
--- a/
drivers/power/gpio-charger.c
+++ b/
drivers/power/gpio-charger.c
@@
-87,6
+87,10
@@
static int __devinit gpio_charger_probe(struct platform_device *pdev)
}
gpio_charger = kzalloc(sizeof(*gpio_charger), GFP_KERNEL);
+ if (!gpio_charger) {
+ dev_err(&pdev->dev, "Failed to alloc driver structure\n");
+ return -ENOMEM;
+ }
charger = &gpio_charger->charger;