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

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

qseecom: improve operation when app unload returns EBUSY



If unload app was failed due to EBUSY, qseecom will not free
app list entry, but just restore app ref_cnt and return EBUSY
to client.

Change-Id: If7b20b52690a34ba9cf1b3c3e96f84583d221dec
Signed-off-by: default avatarZhen Kong <zkong@codeaurora.org>
parent 32ca2775
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -3133,6 +3133,16 @@ static int qseecom_unload_app(struct qseecom_dev_handle *data,

	if (!ptr_app->ref_cnt) {
		ret = __qseecom_unload_app(data, data->client.app_id);
		if (ret == -EBUSY) {
			/*
			 * If unload failed due to EBUSY, don't free mem
			 * just restore app ref_cnt and return -EBUSY
			 */
			pr_warn("unload ta %d(%s) EBUSY\n",
				data->client.app_id, data->client.app_name);
			ptr_app->ref_cnt++;
			return ret;
		}
		spin_lock_irqsave(&qseecom.registered_app_list_lock, flags);
		list_del(&ptr_app->list);
		spin_unlock_irqrestore(&qseecom.registered_app_list_lock,
@@ -3151,7 +3161,6 @@ static int qseecom_unload_app(struct qseecom_dev_handle *data,
	return ret;
}


static int qseecom_prepare_unload_app(struct qseecom_dev_handle *data)
{
	struct qseecom_unload_app_pending_list *entry = NULL;