jz4740-adc: check kmalloc() result
PATCH RESEND 1/1 jz4740-adc: check kmalloc() result
Quoted 1 line
From
40f965e63c4aefb402d85cf8392681565e172d2dMon Sep 17 00:00:00 2001
From: Axel Lin <[email protected]>
Date: Mon, 2 Aug 2010 09:02:02 +0800
Subject: [PATCH] jz4740-adc: check kmalloc() result
If kmalloc() fails exit with -ENOMEM.
---
This patch is against linux-next.
This resend separates the fix for jz4740-hwmon and jz474-adc in 2 patches.
drivers/mfd/jz4740-adc.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/mfd/jz4740-adc.c +4 -0
@@ -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 ) {
Signature · 1 line
1.5.4.3
Hi Axel,
Quoted 6 lines · Axel Lin
Quoted 1 line
From
40f965e63c4aefb402d85cf8392681565e172d2dMon Sep 17 00:00:00 2001From: Axel Lin <[email protected]>
Date: Mon, 2 Aug 2010 09:02:02 +0800
Subject: [PATCH] jz4740-adc: checkkmalloc()resultIf
kmalloc()fails exit with-ENOMEM.
Thanks a lot, patch applied against my for-next branch.
Cheers,
Samuel.
Quoted 27 lines
Signed-off-by Axel Lin <[email protected]>---
This patch is against linux-next.
This resend separates the fix for jz4740-hwmon and jz474-adc in 2 patches.drivers/mfd/jz4740-adc.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)drivers/mfd/jz4740-adc.c +4
-0@@ -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 ) {Signature · 1 line
1.5.4.3
Signature · 2 lines
Intel Open Source Technology Centre http://oss.intel.com/