[PATCH 2/5] drivers/usb/dwc3: zynqmp: only free reset gpio if we have one

Michal Simek monstr at monstr.eu
Fri Sep 1 09:18:22 CEST 2023


st 30. 8. 2023 v 20:16 odesílatel Steffen Dirkwinkel <lists at steffen.cc> napsal:
>
> From: Steffen Dirkwinkel <s.dirkwinkel at beckhoff.com>
>
> This gpio is optional so undonditionally freeing it will crash.
>
> Signed-off-by: Steffen Dirkwinkel <s.dirkwinkel at beckhoff.com>
> ---
>
>  drivers/usb/dwc3/dwc3-generic.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
> index 7f0af05855..dcc342ed04 100644
> --- a/drivers/usb/dwc3/dwc3-generic.c
> +++ b/drivers/usb/dwc3/dwc3-generic.c
> @@ -149,7 +149,9 @@ static int dwc3_generic_remove(struct udevice *dev,
>             priv->ulpi_reset) {
>                 struct gpio_desc *ulpi_reset = priv->ulpi_reset;
>
> -               dm_gpio_free(ulpi_reset->dev, ulpi_reset);
> +               if (priv->ulpi_reset) {
> +                       dm_gpio_free(ulpi_reset->dev, ulpi_reset);
> +               }
>         }
>
>         dwc3_remove(dwc3);
> --
> 2.42.0
>

Already fixed by:
https://lore.kernel.org/all/20230809033350.5718-1-venkatesh.abbarapu@amd.com/

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs


More information about the U-Boot mailing list