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

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

Merge "msm: vidc: Fix error handling for session init failure"

parents 1f806582 2e3a448a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2168,6 +2168,7 @@ static int msm_comm_session_init(int flipped_state,
			"Failed to call session init for: %p, %p, %d, %d\n",
			inst->core->device, inst,
			inst->session_type, fourcc);
		rc = -EINVAL;
		goto exit;
	}
	change_inst_state(inst, MSM_VIDC_OPEN);
+21 −21
Original line number Diff line number Diff line
@@ -2607,6 +2607,26 @@ static void venus_hfi_set_default_sys_properties(
		dprintk(VIDC_WARN, "Setting h/w power collapse ON failed\n");
}

static int venus_hfi_session_clean(void *session)
{
	struct hal_session *sess_close;
	struct venus_hfi_device *device;
	if (!session) {
		dprintk(VIDC_ERR, "Invalid Params %s\n", __func__);
		return -EINVAL;
	}
	sess_close = session;
	device = sess_close->device;
	venus_hfi_flush_debug_queue(sess_close->device, NULL);
	dprintk(VIDC_DBG, "deleted the session: 0x%p\n",
			sess_close);
	mutex_lock(&device->session_lock);
	list_del(&sess_close->list);
	kfree(sess_close);
	mutex_unlock(&device->session_lock);
	return 0;
}

static void *venus_hfi_session_init(void *device, void *session_id,
		enum hal_domain session_type, enum hal_video_codec codec_type)
{
@@ -2651,7 +2671,7 @@ static void *venus_hfi_session_init(void *device, void *session_id,
	return (void *) new_session;

err_session_init_fail:
	kfree(new_session);
	venus_hfi_session_clean(new_session);
	return NULL;
}

@@ -2708,26 +2728,6 @@ static int venus_hfi_session_abort(void *session)
		HFI_CMD_SYS_SESSION_ABORT);
}

static int venus_hfi_session_clean(void *session)
{
	struct hal_session *sess_close;
	struct venus_hfi_device *device;
	if (!session) {
		dprintk(VIDC_ERR, "Invalid Params %s\n", __func__);
		return -EINVAL;
	}
	sess_close = session;
	device = sess_close->device;
	venus_hfi_flush_debug_queue(sess_close->device, NULL);
	dprintk(VIDC_DBG, "deleted the session: 0x%p\n",
			sess_close);
	mutex_lock(&device->session_lock);
	list_del(&sess_close->list);
	kfree(sess_close);
	mutex_unlock(&device->session_lock);
	return 0;
}

static int venus_hfi_session_set_buffers(void *sess,
				struct vidc_buffer_addr_info *buffer_info)
{