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

Commit 88f0b764 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "qseecom: release ION memory if qseecom failed to unload app"

parents 42a98243 17cf4c61
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -2095,9 +2095,14 @@ static int qseecom_unload_app(struct qseecom_dev_handle *data,
	bool found_app = false;
	bool found_dead_app = false;

	if (!data) {
		pr_err("Invalid/uninitialized device handle\n");
		return -EINVAL;
	}

	if (!memcmp(data->client.app_name, "keymaste", strlen("keymaste"))) {
		pr_debug("Do not unload keymaster app from tz\n");
		goto unload_exit;
		return 0;
	}

	if (data->client.app_id > 0) {
@@ -2123,7 +2128,8 @@ static int qseecom_unload_app(struct qseecom_dev_handle *data,
			pr_err("Cannot find app with id = %d (%s)\n",
				data->client.app_id,
				(char *)data->client.app_name);
			return -EINVAL;
			ret = -EINVAL;
			goto unload_exit;
		}
	}

@@ -2146,14 +2152,16 @@ static int qseecom_unload_app(struct qseecom_dev_handle *data,
		if (ret) {
			pr_err("scm_call to unload app (id = %d) failed\n",
								req.app_id);
			return -EFAULT;
			ret = -EFAULT;
			goto unload_exit;
		} else {
			pr_warn("App id %d now unloaded\n", req.app_id);
		}
		if (resp.result == QSEOS_RESULT_FAILURE) {
			pr_err("app (%d) unload_failed!!\n",
					data->client.app_id);
			return -EFAULT;
			ret = -EFAULT;
			goto unload_exit;
		}
		if (resp.result == QSEOS_RESULT_SUCCESS)
			pr_debug("App (%d) is unloaded!!\n",
@@ -2164,7 +2172,7 @@ static int qseecom_unload_app(struct qseecom_dev_handle *data,
			if (ret) {
				pr_err("process_incomplete_cmd fail err: %d\n",
									ret);
				return ret;
				goto unload_exit;
			}
		}
	}