]> git.baikalelectronics.ru Git - kernel.git/commit
optee: smc_abi.c: fix wrong pointer passed to IS_ERR/PTR_ERR()
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 28 Jun 2022 06:52:16 +0000 (14:52 +0800)
committerJens Wiklander <jens.wiklander@linaro.org>
Fri, 8 Jul 2022 07:56:38 +0000 (09:56 +0200)
commitb8cce40d836cde2c263db0536bb747e66190bfad
treeda7b45bf53bb774259ba15bdec966bdec938af73
parent71374b58ebc7666369d670c06d1176f81c437c59
optee: smc_abi.c: fix wrong pointer passed to IS_ERR/PTR_ERR()

In optee_smc_do_call_with_arg() there is a code path when the argument
struct for RPC is passed appended to the primary argument struct. When
the address of the RPC struct is retrieved there's an invalid check for
success. It should be 'rpc_arg' pass to IS_ERR/PTR_ERR().

Fixes: fb2586f9a035 ("optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
[jw: added background to the problem]
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/tee/optee/smc_abi.c