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

Commit 1ee257e5 authored by Zhen Kong's avatar Zhen Kong Committed by Gerrit - the friendly Code Review server
Browse files

qseecom: don't release ion share memory if scm_call unload TA failed



If a scm_call request to shutdown a TA fails, the TA is not shut down
and still in use, and the resources aren't necessarily leaked. Since
shared memory are still locked in this situation, ion shared memory
cannot be released, otherwise XPU violation occurs. Only need to
release shared memory if TA is unloaded success or that TA cannot
be found

Change-Id: I971485fb541193f77960cc7ca14b5b09de938a43
Signed-off-by: default avatarZhen Kong <zkong@codeaurora.org>
parent 53d1dd96
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2151,7 +2151,7 @@ static int qseecom_unload_app(struct qseecom_dev_handle *data,
			pr_err("scm_call to unload app (id = %d) failed\n",
								req.app_id);
			ret = -EFAULT;
			goto unload_exit;
			goto not_release_exit;
		} else {
			pr_warn("App id %d now unloaded\n", req.app_id);
		}
@@ -2159,7 +2159,7 @@ static int qseecom_unload_app(struct qseecom_dev_handle *data,
			pr_err("app (%d) unload_failed!!\n",
					data->client.app_id);
			ret = -EFAULT;
			goto unload_exit;
			goto not_release_exit;
		}
		if (resp.result == QSEOS_RESULT_SUCCESS)
			pr_debug("App (%d) is unloaded!!\n",
@@ -2170,7 +2170,7 @@ static int qseecom_unload_app(struct qseecom_dev_handle *data,
			if (ret) {
				pr_err("process_incomplete_cmd fail err: %d\n",
									ret);
				goto unload_exit;
				goto not_release_exit;
			}
		}
	}
@@ -2200,6 +2200,7 @@ static int qseecom_unload_app(struct qseecom_dev_handle *data,
unload_exit:
	qseecom_unmap_ion_allocated_memory(data);
	data->released = true;
not_release_exit:
	return ret;
}