Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02af8d20 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: isp: protect driver from using invalid bufq"

parents 96aa7a3c 58e19e71
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -43,8 +43,11 @@ struct msm_isp_bufq *msm_isp_get_bufq(
{
	struct msm_isp_bufq *bufq = NULL;
	uint32_t bufq_index = bufq_handle & 0xFF;
	if (bufq_index > buf_mgr->num_buf_q)
		return bufq;

	/* bufq_handle cannot be 0 */
	if ((bufq_handle == 0) ||
		(bufq_index > buf_mgr->num_buf_q))
		return NULL;

	bufq = &buf_mgr->bufq[bufq_index];
	if (bufq->bufq_handle == bufq_handle)