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

Commit 76d72397 authored by xiaocong.gu's avatar xiaocong.gu
Browse files

Integrate security patch 2021-12-05-CVE-2021-30335

Change-Id: Ica6c38222583d0200dd1b715c0b8289d8c44337f
parent 37af0d25
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -470,6 +470,7 @@ struct fastrpc_file {
	struct mutex perf_mutex;
	struct pm_qos_request pm_qos_req;
	int qos_request;
	struct mutex pm_qos_mutex;
	struct mutex map_mutex;
	struct mutex internal_map_mutex;
	/* Identifies the device (MINOR_NUM_DEV / MINOR_NUM_SECURE_DEV) */
@@ -3721,6 +3722,7 @@ static int fastrpc_file_free(struct fastrpc_file *fl)
	mutex_unlock(&fl->perf_mutex);
	mutex_destroy(&fl->perf_mutex);
	mutex_destroy(&fl->map_mutex);
	mutex_destroy(&fl->pm_qos_mutex);
	mutex_destroy(&fl->internal_map_mutex);
	kfree(fl);
	return 0;
@@ -4085,6 +4087,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp)
	hlist_add_head(&fl->hn, &me->drivers);
	spin_unlock(&me->hlock);
	mutex_init(&fl->perf_mutex);
	mutex_init(&fl->pm_qos_mutex);
	return 0;
}

@@ -4211,6 +4214,7 @@ static int fastrpc_internal_control(struct fastrpc_file *fl,
		fl->pm_qos_req.type = PM_QOS_REQ_AFFINE_CORES;
		cpumask_copy(&fl->pm_qos_req.cpus_affine, &mask);

		mutex_lock(&fl->pm_qos_mutex);
		if (!fl->qos_request) {
			pm_qos_add_request(&fl->pm_qos_req,
				PM_QOS_CPU_DMA_LATENCY, latency);
@@ -4218,6 +4222,7 @@ static int fastrpc_internal_control(struct fastrpc_file *fl,
		} else
			pm_qos_update_request(&fl->pm_qos_req, latency);

		mutex_unlock(&fl->pm_qos_mutex);
		/* Ensure CPU feature map updated to DSP for early WakeUp */
		fastrpc_send_cpuinfo_to_dsp(fl);
		break;