diff options
author | Magnus Damm <damm@opensource.se> | 2010-10-13 03:17:45 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-10-13 06:16:44 -0400 |
commit | 1ffbb037d8e81ba4f09901451b39c8f178b05559 (patch) | |
tree | b26afedd31b6805087e3fdd054208454b8d3708e /drivers/video/sh_mobile_lcdcfb.c | |
parent | 51c6c9bb34fcd112d4ab8b8f5c1d1b6a10a00e71 (diff) |
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.c | 6 |
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) | |||
1243 | if (priv->ch[i].sglist) | 1243 | if (priv->ch[i].sglist) |
1244 | vfree(priv->ch[i].sglist); | 1244 | vfree(priv->ch[i].sglist); |
1245 | 1245 | ||
1246 | dma_free_coherent(&pdev->dev, info->fix.smem_len, | 1246 | if (info->screen_base) |
1247 | info->screen_base, priv->ch[i].dma_handle); | 1247 | dma_free_coherent(&pdev->dev, info->fix.smem_len, |
1248 | info->screen_base, | ||
1249 | priv->ch[i].dma_handle); | ||
1248 | fb_dealloc_cmap(&info->cmap); | 1250 | fb_dealloc_cmap(&info->cmap); |
1249 | framebuffer_release(info); | 1251 | framebuffer_release(info); |
1250 | } | 1252 | } |