From: Christophe JAILLET Date: Wed, 18 Aug 2021 19:32:38 +0000 (+0200) Subject: usb: bdc: Fix an error handling path in 'bdc_probe()' when no suitable DMA config... X-Git-Tag: v5.15~423^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d2f42e09393c774ab79088d8e3afcc62b3328fc9;p=platform%2Fkernel%2Flinux-starfive.git usb: bdc: Fix an error handling path in 'bdc_probe()' when no suitable DMA config is available If no suitable DMA configuration is available, a previous 'bdc_phy_init()' call must be undone by a corresponding 'bdc_phy_exit()' call. Branch to the existing error handling path instead of returning directly. Fixes: cc29d4f67757 ("usb: bdc: Add support for USB phy") Acked-by: Florian Fainelli Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/0c5910979f39225d5d8fe68c9ab1c147c68ddee1.1629314734.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c index 0bef6b3..251db57 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_core.c +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c @@ -560,7 +560,8 @@ static int bdc_probe(struct platform_device *pdev) if (ret) { dev_err(dev, "No suitable DMA config available, abort\n"); - return -ENOTSUPP; + ret = -ENOTSUPP; + goto phycleanup; } dev_dbg(dev, "Using 32-bit address\n"); }