diff mbox

sh: free-without-alloc fix for sh_mobile_lcdcfb

Message ID 20101013071745.19716.66656.sendpatchset@t400s (mailing list archive)
State Accepted
Headers show

Commit Message

Magnus Damm Oct. 13, 2010, 7:17 a.m. UTC
None
diff mbox

Patch

--- 0001/drivers/video/sh_mobile_lcdcfb.c
+++ work/drivers/video/sh_mobile_lcdcfb.c	2010-10-07 18:36:45.000000000 +0900
@@ -1324,8 +1324,10 @@  static int sh_mobile_lcdc_remove(struct 
 		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);
 	}