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

Commit 8f460160 authored by Mohit Aggarwal's avatar Mohit Aggarwal
Browse files

memshare: Synchronize memory allocation and free operations



Currently, on Modem SSR, memshare driver receives notification
in which it free up the allocated memory. Due to timing issue,
free is happening after allocation. This patch synchronize
these operations.

Change-Id: I464d3b82f33ccdfd0988ef33fec8414d4ab4a550
Signed-off-by: default avatarMohit Aggarwal <maggarwa@codeaurora.org>
parent fc23af4e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -203,6 +203,7 @@ static int modem_notifier_cb(struct notifier_block *this, unsigned long code,
	int dest_vmids[1] = {VMID_HLOS};
	int dest_perms[1] = {PERM_READ|PERM_WRITE};

	mutex_lock(&memsh_drv->mem_share);
	switch (code) {

	case SUBSYS_BEFORE_SHUTDOWN:
@@ -264,6 +265,7 @@ static int modem_notifier_cb(struct notifier_block *this, unsigned long code,
		break;
	}

	mutex_unlock(&memsh_drv->mem_share);
	return NOTIFY_DONE;
}