Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 789133b7 authored by Axel Lin's avatar Axel Lin Committed by Samuel Ortiz
Browse files

mfd: Check jz4740-adc kmalloc() result



If kmalloc() fails exit with -ENOMEM.

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 48736c80
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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) {