summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2010-01-05 15:27:46 +0530
committerSantosh Shilimkar <santosh.shilimkar@ti.com>2010-01-05 03:40:10 +0530
commit543a4374de5458e1e11d4e30e71c3711b70adf86 (patch)
treea7bd371c9cfc11a554e7fd700b89640a475fe5fd
parent0c350b749c5f49033a8636e630c32b5c5d9db88f (diff)
Check if buffers are allocated before free-ing them
Signed-off-by: Archit Taneja <archit@ti.com>
-rwxr-xr-xdrivers/media/video/omap/omap_vout.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c
index 5aa502fd0a29..a7e996f8fc67 100755
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -555,8 +555,10 @@ static void omap_vout_tiler_buffer_free(struct omap_vout_device *vout,
count = VIDEO_MAX_FRAME - startindex;
for (i = startindex; i < startindex + count; i++) {
- tiler_free_buf(vout->buf_phy_addr_alloced[i]);
- tiler_free_buf(vout->buf_phy_uv_addr_alloced[i]);
+ if (vout->buf_phy_addr_alloced[i])
+ tiler_free_buf(vout->buf_phy_addr_alloced[i]);
+ if (vout->buf_phy_uv_addr_alloced[i])
+ tiler_free_buf(vout->buf_phy_uv_addr_alloced[i]);
vout->buf_phy_addr[i] = 0;
vout->buf_phy_addr_alloced[i] = 0;
vout->buf_phy_uv_addr[i] = 0;