diff mbox

V4L2: clear buf when vrfb buf not allocated

Message ID E0D41E29EB0DAC4E9F3FF173962E9E9402543305C5@dbde02.ent.ti.com (mailing list archive)
State RFC
Headers show

Commit Message

Y, Kishore Nov. 18, 2009, 1:50 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c
index 7092ef2..0a9fdd7 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -223,9 +223,11 @@  static int omap_vout_allocate_vrfb_buffers(struct omap_vout_device *vout,
 		unsigned int *count, int startindex)
 {
 	int i, j;
+	int buffer_set;
 
 	for (i = 0; i < *count; i++) {
-		if (!vout->smsshado_virt_addr[i]) {
+		buffer_set = vout->smsshado_virt_addr[i];
+		if (!buffer_set) {
 			vout->smsshado_virt_addr[i] =
 				omap_vout_alloc_buffer(vout->smsshado_size,
 						&vout->smsshado_phy_addr[i]);
@@ -247,8 +249,10 @@  static int omap_vout_allocate_vrfb_buffers(struct omap_vout_device *vout,
 			*count = 0;
 			return -ENOMEM;
 		}
-		memset((void *) vout->smsshado_virt_addr[i], 0,
-				vout->smsshado_size);
+		if (!buffer_set) {
+			memset((void *) vout->smsshado_virt_addr[i], 0,
+					vout->smsshado_size);
+		}
 	}
 	return 0;
 }