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

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

Merge "adsprpc: Avoid race condition during map find and free"

parents 5f737b69 ca54890d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1002,9 +1002,11 @@ static void fastrpc_mmap_free(struct fastrpc_mmap *map, uint32_t flags)
	}
	if (map->flags == ADSP_MMAP_HEAP_ADDR ||
				map->flags == ADSP_MMAP_REMOTE_HEAP_ADDR) {
		spin_lock(&me->hlock);
		map->refs--;
		if (!map->refs)
			hlist_del_init(&map->hn);
		spin_unlock(&me->hlock);
		if (map->refs > 0) {
			ADSPRPC_WARN(
				"multiple references for remote heap size %zu va 0x%lx ref count is %d\n",