From: Magnus Damm Date: Wed, 13 Oct 2010 07:17:45 +0000 (+0000) Subject: sh: free-without-alloc fix for sh_mobile_lcdcfb X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1ffbb037d8e81ba4f09901451b39c8f178b05559;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git sh: free-without-alloc fix for sh_mobile_lcdcfb Without this fix the LCDC driver will try to free framebuffer memory even though the allocation failed. Signed-off-by: Magnus Damm Signed-off-by: Paul Mundt --- diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index d72075a9f01c..7a1419279c8f 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -1243,8 +1243,10 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) if (priv->ch[i].sglist) vfree(priv->ch[i].sglist); - dma_free_coherent(&pdev->dev, info->fix.smem_len, - info->screen_base, priv->ch[i].dma_handle); + if (info->screen_base) + dma_free_coherent(&pdev->dev, info->fix.smem_len, + info->screen_base, + priv->ch[i].dma_handle); fb_dealloc_cmap(&info->cmap); framebuffer_release(info); }