Commit 73048a83 authored by Dan Carpenter's avatar Dan Carpenter Committed by Ulf Hansson

optee: Fix a NULL vs IS_ERR() check

The tee_shm_get_va() function never returns NULL, it returns error
pointers.  Update the check to match.

Fixes: f0c84315 ("optee: probe RPMB device using RPMB subsystem")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
Link: https://lore.kernel.org/r/f8c12aed-b5d1-4522-bf95-622b8569706d@stanley.mountainSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent cf6444ba
...@@ -332,7 +332,7 @@ static void handle_rpc_func_rpmb_probe_next(struct tee_context *ctx, ...@@ -332,7 +332,7 @@ static void handle_rpc_func_rpmb_probe_next(struct tee_context *ctx,
} }
buf = tee_shm_get_va(params[1].u.memref.shm, buf = tee_shm_get_va(params[1].u.memref.shm,
params[1].u.memref.shm_offs); params[1].u.memref.shm_offs);
if (!buf) { if (IS_ERR(buf)) {
arg->ret = TEEC_ERROR_BAD_PARAMETERS; arg->ret = TEEC_ERROR_BAD_PARAMETERS;
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment