[PATCH] firmware: arm_scmi: Fix fallback to short name in scmi_pinctrl_attributes()

Sudeep Holla sudeep.holla at kernel.org
Thu Nov 5 03:27:05 PST 2026


In scmi_pinctrl_attributes(), the return value of extended_name_get()
is returned directly. If PINCTRL_NAME_GET failed, the error propagated
to callers -  aborting pin/group/function descriptor initialization,
despite the short name already being available in name.

Discard the return value of extended_name_get() and return success as
intended unconditionally after the successful PINCTRL_ATTRIBUTES
transfer. On failure, extended_name_get() won't have overwritten name,
so the short name copied from rx->name remains intact, which is exactly
the fallback behavior described by the existing comment.

Reported-by: Sashiko <sashiko-bot at kernel.org>
Closes: https://sashiko.dev/#/bug/linux-8ef1b8d2-695d-41e8-8b54-5f45fbb5eb1b
Fixes: 2145af01b9cb ("firmware: arm_scmi: Add basic support for SCMI v3.2 pincontrol protocol")
Signed-off-by: Sudeep Holla <sudeep.holla at kernel.org>
---
 drivers/firmware/arm_scmi/pinctrl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/arm_scmi/pinctrl.c b/drivers/firmware/arm_scmi/pinctrl.c
index 42cb1aef1fe1..c8e26168a8a4 100644
--- a/drivers/firmware/arm_scmi/pinctrl.c
+++ b/drivers/firmware/arm_scmi/pinctrl.c
@@ -233,10 +233,10 @@ static int scmi_pinctrl_attributes(const struct scmi_protocol_handle *ph,
 	 * on error just carry on and use already provided short name.
 	 */
 	if (ext_name_flag)
-		ret = ph->hops->extended_name_get(ph, PINCTRL_NAME_GET,
-						  selector, (u32 *)&type, name,
-						  SCMI_MAX_STR_SIZE);
-	return ret;
+		ph->hops->extended_name_get(ph, PINCTRL_NAME_GET,
+					    selector, (u32 *)&type, name,
+					    SCMI_MAX_STR_SIZE);
+	return 0;
 }
 
 struct scmi_pinctrl_ipriv {
-- 
2.43.0




More information about the linux-arm-kernel mailing list