summaryrefslogtreecommitdiffstats
path: root/drivers/video/sh_mobile_lcdcfb.c
diff options
context:
space:
mode:
authorMagnus Damm2010-10-13 09:17:45 +0200
committerPaul Mundt2010-10-13 12:16:44 +0200
commit1ffbb037d8e81ba4f09901451b39c8f178b05559 (patch)
treeb26afedd31b6805087e3fdd054208454b8d3708e /drivers/video/sh_mobile_lcdcfb.c
parentsh: perf: Set up perf_max_events. (diff)
downloadkernel-qcow2-linux-1ffbb037d8e81ba4f09901451b39c8f178b05559.tar.gz
kernel-qcow2-linux-1ffbb037d8e81ba4f09901451b39c8f178b05559.tar.xz
kernel-qcow2-linux-1ffbb037d8e81ba4f09901451b39c8f178b05559.zip
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 <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video/sh_mobile_lcdcfb.c')
-rw-r--r--drivers/video/sh_mobile_lcdcfb.c6
1 files changed, 4 insertions, 2 deletions
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);
}