projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
48736c8
)
mfd: Check jz4740-adc kmalloc() result
author
Axel Lin
<axel.lin@gmail.com>
Mon, 2 Aug 2010 01:02:02 +0000
(09:02 +0800)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Thu, 12 Aug 2010 09:28:02 +0000
(11:28 +0200)
If kmalloc() fails exit with -ENOMEM.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/jz4740-adc.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/mfd/jz4740-adc.c
b/drivers/mfd/jz4740-adc.c
index b30e44ac4d1c5bbef20d48df9643ebc620c70eef..3ad492cb6c4158b9160e3a2fefc7fb6423086ba5 100644
(file)
--- a/
drivers/mfd/jz4740-adc.c
+++ b/
drivers/mfd/jz4740-adc.c
@@
-260,6
+260,10
@@
static int __devinit jz4740_adc_probe(struct platform_device *pdev)
int irq;
adc = kmalloc(sizeof(*adc), GFP_KERNEL);
+ if (!adc) {
+ dev_err(&pdev->dev, "Failed to allocate driver structure\n");
+ return -ENOMEM;
+ }
adc->irq = platform_get_irq(pdev, 0);
if (adc->irq < 0) {