qseecom: remove entry from qseecom_registered_app_list
In an error handling case, the QSEECOM_IOCTL_LOAD_APP_REQ ioctl freed the entry for new TA, but didn't removed it from qseecom_registered_app_list. Make change to remove it. Change-Id: Id681fbf3c923027d3db875d506cbe3f971919a8d Signed-off-by: Zhen Kong <zkong@codeaurora.org>
This commit is contained in:
parent
9c8924dbaa
commit
420d51e073
1 changed files with 10 additions and 1 deletions
|
@ -2071,6 +2071,7 @@ static int qseecom_load_app(struct qseecom_dev_handle *data, void __user *argp)
|
||||||
struct qseecom_load_app_64bit_ireq load_req_64bit;
|
struct qseecom_load_app_64bit_ireq load_req_64bit;
|
||||||
void *cmd_buf = NULL;
|
void *cmd_buf = NULL;
|
||||||
size_t cmd_len;
|
size_t cmd_len;
|
||||||
|
bool first_time = false;
|
||||||
|
|
||||||
/* Copy the relevant information needed for loading the image */
|
/* Copy the relevant information needed for loading the image */
|
||||||
if (copy_from_user(&load_img_req,
|
if (copy_from_user(&load_img_req,
|
||||||
|
@ -2142,6 +2143,7 @@ static int qseecom_load_app(struct qseecom_dev_handle *data, void __user *argp)
|
||||||
&qseecom.registered_app_list_lock, flags);
|
&qseecom.registered_app_list_lock, flags);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
} else {
|
} else {
|
||||||
|
first_time = true;
|
||||||
pr_warn("App (%s) does'nt exist, loading apps for first time\n",
|
pr_warn("App (%s) does'nt exist, loading apps for first time\n",
|
||||||
(char *)(load_img_req.img_name));
|
(char *)(load_img_req.img_name));
|
||||||
/* Get the handle of the shared fd */
|
/* Get the handle of the shared fd */
|
||||||
|
@ -2273,8 +2275,15 @@ static int qseecom_load_app(struct qseecom_dev_handle *data, void __user *argp)
|
||||||
load_img_req.app_id = app_id;
|
load_img_req.app_id = app_id;
|
||||||
if (copy_to_user(argp, &load_img_req, sizeof(load_img_req))) {
|
if (copy_to_user(argp, &load_img_req, sizeof(load_img_req))) {
|
||||||
pr_err("copy_to_user failed\n");
|
pr_err("copy_to_user failed\n");
|
||||||
kzfree(entry);
|
|
||||||
ret = -EFAULT;
|
ret = -EFAULT;
|
||||||
|
if (first_time == true) {
|
||||||
|
spin_lock_irqsave(
|
||||||
|
&qseecom.registered_app_list_lock, flags);
|
||||||
|
list_del(&entry->list);
|
||||||
|
spin_unlock_irqrestore(
|
||||||
|
&qseecom.registered_app_list_lock, flags);
|
||||||
|
kzfree(entry);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loadapp_err:
|
loadapp_err:
|
||||||
|
|
Loading…
Add table
Reference in a new issue