Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Amirreza Zarrabi" <amirreza.zarrabi@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH RFC 07/10] firmware: riscv: rpmi-tee: discover TEE services
Date: Tue, 29 Sep 2026 03:26:25 +0000	[thread overview]
Message-ID: <20260929032625.B5CDB1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260928-riscv-rpmi-tee-abi-v1-7-04908b81d885@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] rpmi_tee: mixed goto-based error handling with scope-based cleanup
--

commit 6089779ce1ff0f765c5a7729a4fc32fd807d547b
Author: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>

firmware: riscv: rpmi-tee: discover TEE services

This commit adds the RPMI TEE service-group message layer to discover
endpoints and services. It introduces requests to probe features and system
info, and registers one RPMI TEE device for each discovered service.

> diff --git a/drivers/firmware/riscv_rpmi_tee/driver.c b/drivers/firmware/riscv_rpmi_tee/driver.c
> --- a/drivers/firmware/riscv_rpmi_tee/driver.c
> +++ b/drivers/firmware/riscv_rpmi_tee/driver.c

[ ... ]

> +static int
> +rpmi_tee_register_devices(struct rpmi_tee_transport *priv,
> +			  const struct rpmi_tee_sysinfo_service_info *services,
> +			  size_t service_count)
> +{
> +	size_t i;
> +	int ret;
> +
> +	for (i = 0; i < service_count; i++) {
> +		const struct rpmi_tee_sysinfo_service_info *service = &services[i];
> +
> +		/* Discard duplicate devices in the same endpoint. */
> +		if (rpmi_tee_find_device(priv, &service->uuid,
> +					 service->endpoint_id))
> +			continue;
> +
> +		struct rpmi_tee_child *child __free(kfree) =
> +			kzalloc_obj(*child, GFP_KERNEL);
> +		if (!child) {
> +			ret = -ENOMEM;
> +			goto err_unregister;

[Severity: Low]
Does this code mix goto-based error handling with scope-based cleanup?

The kernel cleanup guidelines state that the usage of goto and cleanup
helpers like __free() should not be mixed in the same function to prevent
complex ownership semantics. Should rpmi_tee_register_devices() be updated
to either use only goto labels or exclusively scope-based cleanup for its
error paths?

> +		}
> +		child->rdev = rpmi_tee_device_register(&service->uuid,
> +						       service->endpoint_id,
> +						       &rpmi_tee_ops,
> +						       priv->dev);
> +		if (IS_ERR(child->rdev)) {
> +			ret = PTR_ERR(child->rdev);
> +			goto err_unregister;
> +		}
> +
> +		list_add_tail(&no_free_ptr(child)->node, &priv->devices);
> +	}
> +
> +	return 0;
> +
> +err_unregister:
> +	rpmi_tee_unregister_devices(priv);
> +
> +	return ret;
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260928-riscv-rpmi-tee-abi-v1-0-04908b81d885@oss.qualcomm.com?part=7

  reply	other threads:[~2026-09-29  3:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29  3:16 [PATCH RFC 00/10] firmware: riscv: add RPMI TEE service group transport Amirreza Zarrabi
2026-09-29  3:16 ` [PATCH RFC 01/10] mailbox: add direct synchronous send support Amirreza Zarrabi
2026-09-29  3:31   ` sashiko-bot
2026-09-29  3:16 ` [PATCH RFC 02/10] mailbox: mpxy: add direct synchronous send Amirreza Zarrabi
2026-09-29  3:31   ` sashiko-bot
2026-09-29  3:16 ` [PATCH RFC 03/10] firmware: add RPMI TEE bus support Amirreza Zarrabi
2026-09-29  3:29   ` sashiko-bot
2026-09-29  3:16 ` [PATCH RFC 04/10] dt-bindings: firmware: add RISC-V RPMI TEE transport Amirreza Zarrabi
2026-09-29  3:16 ` [PATCH RFC 05/10] firmware: add RPMI TEE transport core Amirreza Zarrabi
2026-09-29  3:16 ` [PATCH RFC 06/10] firmware: riscv: rpmi-tee: parse system information tables Amirreza Zarrabi
2026-09-29  3:26   ` sashiko-bot
2026-09-29  3:16 ` [PATCH RFC 07/10] firmware: riscv: rpmi-tee: discover TEE services Amirreza Zarrabi
2026-09-29  3:26   ` sashiko-bot [this message]
2026-09-29  3:16 ` [PATCH RFC 08/10] firmware: riscv: rpmi-tee: cache TEE capabilities Amirreza Zarrabi
2026-09-29  3:17 ` [PATCH RFC 09/10] firmware: riscv: rpmi-tee: add memory parcel operations Amirreza Zarrabi
2026-09-29  3:29   ` sashiko-bot
2026-09-29  3:17 ` [PATCH RFC 10/10] firmware: riscv: rpmi-tee: add signal bus support Amirreza Zarrabi
2026-09-29  3:29   ` sashiko-bot

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=20260929032625.B5CDB1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=amirreza.zarrabi@oss.qualcomm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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