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

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

Merge "msm: cam: reqmgr: Add list empty check for task list" into msm-4.9

parents 2922181a 692ef308
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -22,12 +22,16 @@ struct crm_workq_task *cam_req_mgr_workq_get_task(
		return NULL;

	spin_lock(&workq->task.lock);
	if (list_empty(&workq->task.empty_head))
		goto end;

	task = list_first_entry(&workq->task.empty_head,
		struct crm_workq_task, entry);
	if (task) {
		atomic_sub(1, &workq->task.free_cnt);
		list_del_init(&task->entry);
	}
end:
	spin_unlock(&workq->task.lock);

	return task;