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

Commit e1ec022f authored by Jeya R's avatar Jeya R Committed by Gerrit - the friendly Code Review server
Browse files

msm: adsprpc: Lock list before removing node



Lock map list before removing node.

Change-Id: Ic3cfc7cd49381deca8ccaa0008df04a389bfb3e8
Acked-by: default avatarDeepika Singh <dsi@qti.qualcomm.com>
Signed-off-by: default avatarJeya R <jeyr@codeaurora.org>
parent 2228488a
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -3198,17 +3198,13 @@ static int fastrpc_mmap_remove_ssr(struct fastrpc_file *fl)
					kfree(ramdump_segments_rh);
				}
			}
			mutex_lock(&fl->map_mutex);
			fastrpc_mmap_free(match, 0);
			mutex_unlock(&fl->map_mutex);
		}
	} while (match);
	me->enable_ramdump = false;
bail:
	if (err && match) {
		mutex_lock(&fl->map_mutex);
		fastrpc_mmap_add(match);
		mutex_unlock(&fl->map_mutex);
	}
	return err;
}
@@ -4018,13 +4014,13 @@ static int fastrpc_channel_open(struct fastrpc_file *fl)

	if (cid == ADSP_DOMAIN_ID && me->channel[cid].ssrcount !=
			 me->channel[cid].prevssrcount) {
		mutex_unlock(&me->channel[cid].smd_mutex);
		mutex_lock(&fl->map_mutex);
		err = fastrpc_mmap_remove_ssr(fl);
		if (err)
			pr_warn("adsprpc: %s: %s: failed to unmap remote heap for %s (err %d)\n",
					__func__, current->comm,
					me->channel[cid].subsys, err);
		mutex_lock(&me->channel[cid].smd_mutex);
		mutex_unlock(&fl->map_mutex);
		me->channel[cid].prevssrcount =
					me->channel[cid].ssrcount;
	}