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

Commit 7e5fc94d authored by Camera Software Integration's avatar Camera Software Integration Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: smmu: add null check for memory slot function" into camera-kernel.lnx.1.0

parents c96c341d 4625e145
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -177,6 +177,7 @@ static int32_t cam_mem_get_slot(void)
	int32_t idx;

	mutex_lock(&tbl.m_lock);
	if (tbl.bitmap) {
		idx = find_first_zero_bit(tbl.bitmap, tbl.bits);
		if (idx >= CAM_MEM_BUFQ_MAX || idx <= 0) {
			mutex_unlock(&tbl.m_lock);
@@ -187,10 +188,13 @@ static int32_t cam_mem_get_slot(void)
		tbl.bufq[idx].active = true;
		mutex_init(&tbl.bufq[idx].q_lock);
		mutex_unlock(&tbl.m_lock);

		return idx;
	}

	mutex_unlock(&tbl.m_lock);
	return -EINVAL;
}

static void cam_mem_put_slot(int32_t idx)
{
	mutex_lock(&tbl.m_lock);