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

Commit 49cb0811 authored by Anmolpreet Kaur's avatar Anmolpreet Kaur
Browse files

smcinvoke: Return proper error in process_accept_req



When the userspace sends a wrong transaction id or the
invoke threads have died for some reason, then there will
be no cb_txn in the responses table. In such case, we
should send a signal to userspace to send the thread again
so that it starts waiting for new callback requests. This
change adds the valid return value to be sent to userspace
to address the same.

Change-Id: I69fe45c3db8b1a0f44e43a9b926c42c73be6ffca
Signed-off-by: default avatarAnmolpreet Kaur <anmolpre@codeaurora.org>
parent 283c2816
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1534,10 +1534,13 @@ static long process_accept_req(struct file *filp, unsigned int cmd,
		 * invoke thread died while server was processing cb req.
		 * if invoke thread dies, it would remove req from Q. So
		 * no matching cb_txn would be on Q and hence NULL cb_txn.
		 * In this case, we want this thread to come back and start
		 * waiting for new cb requests, hence return EAGAIN here
		 */
		if (!cb_txn) {
			pr_err("%s txn %d either invalid or removed from Q\n",
					__func__, user_args.txn_id);
			ret = -EAGAIN;
			goto out;
		}
		ret = marshal_out_tzcb_req(&user_args, cb_txn,