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

Commit 0aa054de authored by Mona Hossain's avatar Mona Hossain
Browse files

qseecom: Check for case where listener service is not found



When listerner service is not in the list of registered listener,
the resulting ptr will a NULL.  Check for this case of NULL ptr
to indicate missing listener service.

Change-Id: I0d2c7b01143c40711f71bf434493ac5301314cf2
Signed-off-by: default avatarMona Hossain <mhossain@codeaurora.org>
parent d6e87cbf
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -646,6 +646,11 @@ static int __qseecom_process_incomplete_cmd(struct qseecom_dev_handle *data,
		}
		spin_unlock_irqrestore(&qseecom.registered_listener_list_lock,
				flags);

		if (ptr_svc == NULL) {
			pr_err("Listener Svc %d does not exist\n", lstnr);
			return -EINVAL;
		}
		if (ptr_svc->svc.listener_id != lstnr) {
			pr_warning("Service requested for does on exist\n");
			return -ERESTARTSYS;