From: Pramod Gurav Date: Tue, 26 Aug 2014 12:52:58 +0000 (+0530) Subject: msm: msm_fb: Move to using managed resources of kzalloc X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fbaa19df03f87c2aa6a3a0a14dd7d4c098d45643;p=linux-beck.git msm: msm_fb: Move to using managed resources of kzalloc Move to managed verion of kzalloc. Also checks return for failure case which was missing. Signed-off-by: Pramod Gurav CC: Jean-Christophe Plagniol-Villard CC: Tomi Valkeinen CC: Stephen Boyd CC: Jingoo Han CC: Rob Clark Signed-off-by: Tomi Valkeinen --- diff --git a/drivers/video/fbdev/msm/msm_fb.c b/drivers/video/fbdev/msm/msm_fb.c index 4640188ffd6e..2979d7e72126 100644 --- a/drivers/video/fbdev/msm/msm_fb.c +++ b/drivers/video/fbdev/msm/msm_fb.c @@ -569,8 +569,13 @@ static int msmfb_probe(struct platform_device *pdev) mutex_init(&msmfb->panel_init_lock); init_waitqueue_head(&msmfb->frame_wq); INIT_WORK(&msmfb->resume_work, power_on_panel); - msmfb->black = kzalloc(msmfb->fb->var.bits_per_pixel*msmfb->xres, - GFP_KERNEL); + msmfb->black = devm_kzalloc(&pdev->dev, + msmfb->fb->var.bits_per_pixel*msmfb->xres, + GFP_KERNEL); + if (!msmfb->black) { + ret = -ENOMEM; + goto error_register_framebuffer; + } printk(KERN_INFO "msmfb_probe() installing %d x %d panel\n", msmfb->xres, msmfb->yres);