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

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

Merge "qseecom: remove entry from qseecom_registered_app_list"

parents b551fb59 cd70f602
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -2183,6 +2183,7 @@ static int qseecom_load_app(struct qseecom_dev_handle *data, void __user *argp)
	struct qseecom_load_app_64bit_ireq load_req_64bit;
	void *cmd_buf = NULL;
	size_t cmd_len;
	bool first_time = false;

	/* Copy the relevant information needed for loading the image */
	if (copy_from_user(&load_img_req,
@@ -2254,6 +2255,7 @@ static int qseecom_load_app(struct qseecom_dev_handle *data, void __user *argp)
		&qseecom.registered_app_list_lock, flags);
		ret = 0;
	} else {
		first_time = true;
		pr_warn("App (%s) does'nt exist, loading apps for first time\n",
			(char *)(load_img_req.img_name));
		/* Get the handle of the shared fd */
@@ -2385,8 +2387,15 @@ static int qseecom_load_app(struct qseecom_dev_handle *data, void __user *argp)
	load_img_req.app_id = app_id;
	if (copy_to_user(argp, &load_img_req, sizeof(load_img_req))) {
		pr_err("copy_to_user failed\n");
		kzfree(entry);
		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: