rk3188 lcdc: fix kernel panic when rk3188 lcdc probe failed

memory allocated by devm_kzalloc will be freed automatically
	on driver detach
	0.881936] Unable to handle kernel paging request at virtual address 6c6175a4
	[    0.919447] pgd = c0404000
	[    0.922174] [6c6175a4] *pgd=00000000
	[    0.925767] Internal error: Oops: 5 [#1] PREEMPT SMP
	[    0.930742] CPU: 0    Not tainted  (3.0.36+ #573)
	[    0.935463] PC is at bus_probe_device+0x10/0x40
	[    0.940002] LR is at device_add+0x4c0/0x58c
	[    0.944192] pc : [<c064a470>]    lr : [<c06494d4>]    psr: 20000013
	[    0.944203] sp : f0043f08  ip : 02d4e000  fp : 00000000
	[    0.955692] r10: c041ad14  r9 : f023d5c0  r8 : f00038c0
	[    0.960923] r7 : 00000000  r6 : 00000000  r5 : f0258c08  r4 : f0258c00
	[    0.967458] r3 : 6c617574  r2 : c0aad790  r1 : 60000013  r0 : f0258c00
	[    0.973995] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
	[    0.981313] Control: 10c5387d  Table: 6040404a  DAC: 00000015
This commit is contained in:
yxj 2013-01-29 00:04:58 +08:00
parent 9f9adfdf65
commit 6bdce8eede

View File

@ -1334,8 +1334,8 @@ static int __devinit rk3188_lcdc_probe(struct platform_device *pdev)
else
{
printk(KERN_WARNING "no display device on lcdc%d!?\n",lcdc_dev->id);
ret = -ENODEV;
goto err4;
ret = -ENODEV;
goto err3;
}
init_waitqueue_head(&lcdc_dev->vsync_info.wait);
@ -1359,12 +1359,13 @@ static int __devinit rk3188_lcdc_probe(struct platform_device *pdev)
dev_err(dev,"register fb for lcdc%d failed!\n",lcdc_dev->id);
goto err4;
}
printk("rk3188 lcdc%d probe ok!\n",lcdc_dev->id);
return 0;
err4:
free_irq(lcdc_dev->irq,lcdc_dev);
device_remove_file(&pdev->dev, &dev_attr_vsync);
err3:
iounmap(lcdc_dev->regs);
err2:
@ -1373,8 +1374,7 @@ static int __devinit rk3188_lcdc_probe(struct platform_device *pdev)
kfree(screen);
err0:
platform_set_drvdata(pdev, NULL);
kfree(lcdc_dev);
return ret;
}