diff options
| author | Zhen Kong <zkong@codeaurora.org> | 2016-03-09 15:40:25 -0800 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-25 16:03:33 -0700 |
| commit | 2afa0098267ca5419b609bc47592de4fd32d7d91 (patch) | |
| tree | 83a021b8cfc8dad2377c86ad4eaaa992b7454298 /drivers | |
| parent | da15ce4aa9cb993f8c3da4623faaf8dab4885e33 (diff) | |
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: Zhen Kong <zkong@codeaurora.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/misc/qseecom.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/misc/qseecom.c b/drivers/misc/qseecom.c index 0645ca41b977..e4694b6d5f5b 100644 --- a/drivers/misc/qseecom.c +++ b/drivers/misc/qseecom.c @@ -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; } |
