Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <pramod.gurav@smartplayin.com>

CC: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
CC: Tomi Valkeinen <tomi.valkeinen@ti.com>
CC: Stephen Boyd <sboyd@codeaurora.org>
CC: Jingoo Han <jg1.han@samsung.com>
CC: Rob Clark <robdclark@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

authored by

Pramod Gurav and committed by
Tomi Valkeinen
fbaa19df 0c46575f

+7 -2
+7 -2
drivers/video/fbdev/msm/msm_fb.c
··· 569 569 mutex_init(&msmfb->panel_init_lock); 570 570 init_waitqueue_head(&msmfb->frame_wq); 571 571 INIT_WORK(&msmfb->resume_work, power_on_panel); 572 - msmfb->black = kzalloc(msmfb->fb->var.bits_per_pixel*msmfb->xres, 573 - GFP_KERNEL); 572 + msmfb->black = devm_kzalloc(&pdev->dev, 573 + msmfb->fb->var.bits_per_pixel*msmfb->xres, 574 + GFP_KERNEL); 575 + if (!msmfb->black) { 576 + ret = -ENOMEM; 577 + goto error_register_framebuffer; 578 + } 574 579 575 580 printk(KERN_INFO "msmfb_probe() installing %d x %d panel\n", 576 581 msmfb->xres, msmfb->yres);