From 1f9b4f459aaad2e53c6a83e50f4c560b92c05df9 Mon Sep 17 00:00:00 2001 From: Maheshwar Ajja Date: Tue, 9 Jul 2013 18:45:26 +0530 Subject: [PATCH] msm: vidc: Amend error check conditions on ION APIs Amend error check conditions appropriately to return properly from video applications in case of ION API failures. Change-Id: Ibe95a8438a66e88b35dbff0af8842ff4b038c5e1 Signed-off-by: Maheshwar Ajja --- drivers/video/msm/vidc/common/dec/vdec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/msm/vidc/common/dec/vdec.c b/drivers/video/msm/vidc/common/dec/vdec.c index 32ad79f7c71f..978466fac5f2 100644 --- a/drivers/video/msm/vidc/common/dec/vdec.c +++ b/drivers/video/msm/vidc/common/dec/vdec.c @@ -2271,7 +2271,7 @@ static long vid_dec_ioctl(struct file *file, client_ctx->seq_hdr_ion_handle = ion_import_dma_buf( client_ctx->user_ion_client, seq_header.pmem_fd); - if (!client_ctx->seq_hdr_ion_handle) { + if (IS_ERR_OR_NULL(client_ctx->seq_hdr_ion_handle)) { ERR("%s(): get_ION_handle failed\n", __func__); return false; } @@ -2288,7 +2288,7 @@ static long vid_dec_ioctl(struct file *file, ker_vaddr = (unsigned long) ion_map_kernel( client_ctx->user_ion_client, client_ctx->seq_hdr_ion_handle); - if (!ker_vaddr) { + if (IS_ERR_OR_NULL((void *)ker_vaddr)) { ERR("%s():get_ION_kernel virtual addr fail\n", __func__); ion_free(client_ctx->user_ion_client, @@ -2331,7 +2331,7 @@ static long vid_dec_ioctl(struct file *file, return -EFAULT; } if (vcd_get_ion_status()) { - if (client_ctx->seq_hdr_ion_handle) { + if (!IS_ERR_OR_NULL(client_ctx->seq_hdr_ion_handle)) { ion_unmap_kernel(client_ctx->user_ion_client, client_ctx->seq_hdr_ion_handle); ion_free(client_ctx->user_ion_client,