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

Commit ccafee2d authored by Jeya R's avatar Jeya R
Browse files

msm: adsprpc: Check fastrpc file pointer before accessing it



Fastrpc file pointer is assigned NULL value for remote heap region
allocated from CMA. Avoid accessing of this NULL pointer while freeing
the remote heap mapping.

Change-Id: Id4bdc1ff326e5b00937e21ac7eb76d518ecf7ee4
Signed-off-by: default avatarJeya R <jeyr@codeaurora.org>
parent 0e71976f
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -727,6 +727,8 @@ static void fastrpc_mmap_free(struct fastrpc_mmap *map, uint32_t flags)
	if (!map)
		return;
	fl = map->fl;
	if (fl && !(map->flags == ADSP_MMAP_HEAP_ADDR ||
				map->flags == ADSP_MMAP_REMOTE_HEAP_ADDR)) {
		cid = fl->cid;
		VERIFY(err, cid >= ADSP_DOMAIN_ID && cid < NUM_CHANNELS);
		if (err) {
@@ -735,6 +737,7 @@ static void fastrpc_mmap_free(struct fastrpc_mmap *map, uint32_t flags)
				__func__, cid, err);
			return;
		}
	}
	if (map->flags == ADSP_MMAP_HEAP_ADDR ||
				map->flags == ADSP_MMAP_REMOTE_HEAP_ADDR) {
		spin_lock(&me->hlock);