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: f0c8431568 ("optee: probe RPMB device using RPMB subsystem")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Link: https://lore.kernel.org/r/f8c12aed-b5d1-4522-bf95-622b8569706d@stanley.mountain
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Dan Carpenter 2024-09-05 16:17:06 +03:00 committed by Ulf Hansson
parent cf6444ba52
commit 73048a8325

View File

@ -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,
params[1].u.memref.shm_offs);
if (!buf) {
if (IS_ERR(buf)) {
arg->ret = TEEC_ERROR_BAD_PARAMETERS;
return;
}