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 <majja@codeaurora.org>
This commit is contained in:
Maheshwar Ajja 2013-07-09 18:45:26 +05:30 committed by Artem Borisov
parent 6a9440707a
commit 1f9b4f459a

View file

@ -2271,7 +2271,7 @@ static long vid_dec_ioctl(struct file *file,
client_ctx->seq_hdr_ion_handle = ion_import_dma_buf( client_ctx->seq_hdr_ion_handle = ion_import_dma_buf(
client_ctx->user_ion_client, client_ctx->user_ion_client,
seq_header.pmem_fd); 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__); ERR("%s(): get_ION_handle failed\n", __func__);
return false; return false;
} }
@ -2288,7 +2288,7 @@ static long vid_dec_ioctl(struct file *file,
ker_vaddr = (unsigned long) ion_map_kernel( ker_vaddr = (unsigned long) ion_map_kernel(
client_ctx->user_ion_client, client_ctx->user_ion_client,
client_ctx->seq_hdr_ion_handle); 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", ERR("%s():get_ION_kernel virtual addr fail\n",
__func__); __func__);
ion_free(client_ctx->user_ion_client, ion_free(client_ctx->user_ion_client,
@ -2331,7 +2331,7 @@ static long vid_dec_ioctl(struct file *file,
return -EFAULT; return -EFAULT;
} }
if (vcd_get_ion_status()) { 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, ion_unmap_kernel(client_ctx->user_ion_client,
client_ctx->seq_hdr_ion_handle); client_ctx->seq_hdr_ion_handle);
ion_free(client_ctx->user_ion_client, ion_free(client_ctx->user_ion_client,