summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhaowei Yuan <zhaowei.yuan@samsung.com>2014-08-01 13:51:12 +0800
committerChanho Park <chanho61.park@samsung.com>2014-08-07 15:17:59 +0900
commit1d516b14c32421b6ed26e201f3eee20c9f4cae20 (patch)
tree0daf0a08344ff21163bd62edbc838e81ff0972ee
parent844361af11f67f5374352ecc6f41f0a20d4f8be9 (diff)
downloadlinux-3.10-1d516b14c32421b6ed26e201f3eee20c9f4cae20.tar.gz
linux-3.10-1d516b14c32421b6ed26e201f3eee20c9f4cae20.tar.bz2
linux-3.10-1d516b14c32421b6ed26e201f3eee20c9f4cae20.zip
media: s5p_mfc: Check the return value of allocation routine
Check the return value of allocation routine and deal with failure. Change-Id: Ie7df5962de5928812d1a81bb648258314c0699d1 Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
-rwxr-xr-x[-rw-r--r--]drivers/media/platform/s5p-mfc/s5p_mfc_dec.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
index 414e4506037..ff9841029a9 100644..100755
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
@@ -687,10 +687,18 @@ static int vidioc_streamon(struct file *file, void *priv,
ctx->src_bufs_cnt = 0;
ctx->capture_state = QUEUE_FREE;
ctx->output_state = QUEUE_FREE;
- s5p_mfc_hw_call(dev->mfc_ops, alloc_instance_buffer,
+ ret = s5p_mfc_hw_call(dev->mfc_ops, alloc_instance_buffer,
ctx);
- s5p_mfc_hw_call(dev->mfc_ops, alloc_dec_temp_buffers,
+ if(ret)
+ return ret;
+
+ ret = s5p_mfc_hw_call(dev->mfc_ops, alloc_dec_temp_buffers,
ctx);
+ if(ret) {
+ s5p_mfc_hw_call(dev->mfc_ops, release_instance_buffer, ctx);
+ return ret;
+ }
+
set_work_bit_irqsave(ctx);
s5p_mfc_clean_ctx_int_flags(ctx);
s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);