diff mbox series

[1/2] usb: bdc: Fix an error handling path in 'bdc_probe()' when no suitable DMA config is available

Message ID 0c5910979f39225d5d8fe68c9ab1c147c68ddee1.1629314734.git.christophe.jaillet@wanadoo.fr (mailing list archive)
State Accepted
Commit d2f42e09393c774ab79088d8e3afcc62b3328fc9
Headers show
Series [1/2] usb: bdc: Fix an error handling path in 'bdc_probe()' when no suitable DMA config is available | expand

Commit Message

Christophe JAILLET Aug. 18, 2021, 7:32 p.m. UTC
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")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
checkpatch.pl warns that:
   WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP
   #29: FILE: drivers/usb/gadget/udc/bdc/bdc_core.c:563:
   +			ret = -ENOTSUPP;
I've never seen this warning before and don't want to make a blind fix for that.
Let me know if I should fix it or not.
---
drivers/usb/gadget/udc/bdc/bdc_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Florian Fainelli Aug. 20, 2021, 8:01 p.m. UTC | #1
On 8/18/2021 9:32 PM, Christophe JAILLET wrote:
> 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")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
diff mbox series

Patch

diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c
index 0bef6b3f049b..251db57e51fa 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");
 	}