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

Commit 3e966761 authored by Tharun Kumar Merugu's avatar Tharun Kumar Merugu
Browse files

adsprpc: update mmap list nodes before mmap free



Update mmap list links before every mmap free.

Change-Id: Icb612a329e8defd65414842bae20f459c02364b9
Acked-by: default avatarThyagarajan Venkatanarayanan <venkatan@qti.qualcomm.com>
Signed-off-by: default avatarTharun Kumar Merugu <mtharu@codeaurora.org>
parent 20f19243
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -2663,7 +2663,7 @@ static void fastrpc_session_free(struct fastrpc_channel_ctx *chan,
static int fastrpc_file_free(struct fastrpc_file *fl)
{
	struct hlist_node *n = NULL;
	struct fastrpc_mmap *map = NULL;
	struct fastrpc_mmap *map = NULL, *lmap = NULL;
	struct fastrpc_perf *perf = NULL, *fperf = NULL;
	int cid;

@@ -2687,9 +2687,15 @@ static int fastrpc_file_free(struct fastrpc_file *fl)
	fastrpc_context_list_dtor(fl);
	fastrpc_buf_list_free(fl);
	mutex_lock(&fl->fl_map_mutex);
	do {
		lmap = NULL;
		hlist_for_each_entry_safe(map, n, &fl->maps, hn) {
		fastrpc_mmap_free(map, 1);
			hlist_del_init(&map->hn);
			lmap = map;
			break;
		}
		fastrpc_mmap_free(lmap, 1);
	} while (lmap);
	mutex_unlock(&fl->fl_map_mutex);
	if (fl->refcount && (fl->ssrcount == fl->apps->channel[cid].ssrcount))
		kref_put_mutex(&fl->apps->channel[cid].kref,