From fe56f2d9abe4666646f672b2b4da6db6148a5ab5 Mon Sep 17 00:00:00 2001 From: Jiten Patel Date: Mon, 28 Sep 2020 10:41:15 +0530 Subject: [PATCH] soc: qcom: Fix smcinvoke_obj->fd assignment Removed conditional assignment of smcinvoke_obj->fd. This handles the condition when fd created in get_uhandle_from_tzhandle is less than zero. Change-Id: I824795ba2f14bbf363d86ef21499f71d74f45537 Signed-off-by: Jiten Patel --- drivers/soc/qcom/smcinvoke.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/qcom/smcinvoke.c b/drivers/soc/qcom/smcinvoke.c index d34aad741e6d..bbfe6a4b92b8 100644 --- a/drivers/soc/qcom/smcinvoke.c +++ b/drivers/soc/qcom/smcinvoke.c @@ -1164,8 +1164,7 @@ static int marshal_out_invoke_req(const uint8_t *buf, uint32_t buf_size, TZHANDLE_GET_SERVER(tz_args->handle), &temp_fd, NO_LOCK); - if (temp_fd >= 0) - args_buf[i].o.fd = temp_fd; + args_buf[i].o.fd = temp_fd; if (ret) goto out; @@ -1451,8 +1450,7 @@ static int marshal_in_tzcb_req(const struct smcinvoke_cb_txn *cb_txn, ret = get_uhandle_from_tzhandle(tz_args[i].handle, srvr_id, &temp_fd, TAKE_LOCK); - if (temp_fd >= 0) - tmp_arg.o.fd = temp_fd; + tmp_arg.o.fd = temp_fd; if (ret) { ret = -EINVAL;