From: Markus Elfring <Markus.Elfring@web.de>
To: Chen Ni <nichen@iscas.ac.cn>,
op-tee@lists.trustedfirmware.org,
Jens Wiklander <jens.wiklander@linaro.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Sumit Garg <sumit.garg@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>
Subject: Re: [PATCH] optee: Check return value of tee_shm_get_va()
Date: Fri, 6 Mar 2026 12:52:39 +0100 [thread overview]
Message-ID: <2e15b2b8-7dd4-4e63-b9a9-a664323ebb36@web.de> (raw)
In-Reply-To: <20260305083312.1040969-1-nichen@iscas.ac.cn>
…
> +++ b/drivers/tee/optee/rpc.c
> @@ -393,6 +393,11 @@ static void handle_rpc_func_rpmb_frames(struct tee_context *ctx,
> params[0].u.memref.shm_offs);
> p1 = tee_shm_get_va(params[1].u.memref.shm,
> params[1].u.memref.shm_offs);
> + if (IS_ERR(p0) || IS_ERR(p1)) {
> + arg->ret = TEEC_ERROR_BAD_PARAMETERS;
> + goto out;
> + }
> +
> if (rpmb_route_frames(rdev, p0, params[0].u.memref.size, p1,
> params[1].u.memref.size)) {
> arg->ret = TEEC_ERROR_BAD_PARAMETERS;
…
How do you think about to use an additional label for the shown
error code assignment?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v7.0-rc2#n526
Regards,
Markus
next prev parent reply other threads:[~2026-03-06 11:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 8:33 Chen Ni
2026-03-06 11:52 ` Markus Elfring [this message]
2026-03-12 9:16 ` Sumit Garg
2026-03-12 11:16 ` Jens Wiklander
2026-03-15 5:02 ` Sumit Garg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2e15b2b8-7dd4-4e63-b9a9-a664323ebb36@web.de \
--to=markus.elfring@web.de \
--cc=jens.wiklander@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nichen@iscas.ac.cn \
--cc=op-tee@lists.trustedfirmware.org \
--cc=sumit.garg@kernel.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®