浏览代码

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>
Magnus Damm 14 年之前
父节点
当前提交
1ffbb037d8
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      drivers/video/sh_mobile_lcdcfb.c

+ 4 - 2
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);
 	}