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

Commit 101705d2 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Handle race condition for accessing session head"

parents 459ecf6e 34f376cc
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1984,18 +1984,20 @@ static int venus_hfi_session_end(void *sess)
	struct venus_hfi_device *device = &venus_hfi_dev;
	int rc = 0;

	if (!__is_session_valid(device, session, __func__))
		return -EINVAL;

	mutex_lock(&device->lock);
	if (!__is_session_valid(device, session, __func__)) {
		rc = -EINVAL;
		goto exit;
	}

	if (msm_vidc_fw_coverage) {
		if (__sys_set_coverage(device, msm_vidc_fw_coverage,
				session->sid))
			s_vpr_e(session->sid, "Fw_coverage msg ON failed\n");
	}
	rc = __send_session_cmd(session, HFI_CMD_SYS_SESSION_END);
exit:
	mutex_unlock(&device->lock);

	return rc;
}