msm: camera: Fix for dual ISP buffer management

Return -1 when there is no free buffer for dual ISP use case,
in order to have proper error handling in isp driver..

Change-Id: Ic3f3261bebe192fdcf62a1d06f4e8a1e6033ef61
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
This commit is contained in:
Kevin Chan 2013-04-24 06:39:04 -07:00 committed by Stephen Boyd
parent 69ea0387cd
commit 3a5c1c7ae3

View file

@ -287,13 +287,15 @@ static int msm_isp_get_buf(struct msm_isp_buf_mgr *buf_mgr, uint32_t id,
bufq->buf_client_count)
list_del_init(
&temp_buf_info->share_list);
if (temp_buf_info->buf_reuse_flag)
if (temp_buf_info->buf_reuse_flag) {
kfree(temp_buf_info);
else
} else {
*buf_info = temp_buf_info;
rc = 0;
}
spin_unlock_irqrestore(
&bufq->bufq_lock, flags);
return 0;
return rc;
}
}
}
@ -342,6 +344,7 @@ static int msm_isp_get_buf(struct msm_isp_buf_mgr *buf_mgr, uint32_t id,
(*buf_info)->buf_used[id] = 1;
(*buf_info)->buf_get_count = 1;
(*buf_info)->buf_put_count = 0;
(*buf_info)->buf_reuse_flag = 0;
list_add_tail(&(*buf_info)->share_list,
&bufq->share_head);
}