[PATCH 10/13] drivers/video: fsl-diu-fb: fix memory leak on error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We were forgetting to unmap the video memory if fsl_diu_check_var() fails.

Signed-off-by: Timur Tabi <timur@xxxxxxxxxxxxx>
---
 drivers/video/fsl-diu-fb.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 3776949..c66f6ed 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -1200,6 +1200,7 @@ static int __devinit install_fb(struct fb_info *info)
 
 	if (fsl_diu_check_var(&info->var, info)) {
 		dev_err(info->dev, "fsl_diu_check_var failed\n");
+		unmap_video_memory(info);
 		fb_dealloc_cmap(&info->cmap);
 		return -EINVAL;
 	}
-- 
1.7.3.4


--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Tourism]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux