[PATCH] usb: fsl-dt-fixup: Return an error code on error

Marek Vasut marek.vasut at mailbox.org
Thu Sep 25 14:05:51 CEST 2025


On 9/25/25 1:56 PM, Andrew Goodbody wrote:
> fsl_fdt_fixup_usb_erratum uses strcmp to detect an error but then
> returns 'err' without it being set to an error. Calling code may not
> detect that an error occurred leading to a silent failure. Instead just
> return -EINVAL.
> 
> This issue was found by Smatch.
> 
> Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>
> ---
>   drivers/usb/common/fsl-dt-fixup.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/common/fsl-dt-fixup.c b/drivers/usb/common/fsl-dt-fixup.c
> index 6a68bd76c27..55176f7a871 100644
> --- a/drivers/usb/common/fsl-dt-fixup.c
> +++ b/drivers/usb/common/fsl-dt-fixup.c
> @@ -99,7 +99,7 @@ static int fsl_fdt_fixup_usb_erratum(void *blob, const char *prop_erratum,
>   	else
>   		node_name = node_type;
>   	if (strcmp(node_name, controller_type))
> -		return err;
> +		return -EINVAL;
>   
>   	err = fdt_setprop(blob, node_offset, prop_erratum, NULL, 0);
>   	if (err < 0) {
+CC NXP person.

The change does look valid.


More information about the U-Boot mailing list