diff mbox series

usb: gadget: fusb300_udc: free irq on the error path in fusb300_probe()

Message ID 20221120061242.261839-1-cuigaosheng1@huawei.com
State New
Headers show
Series usb: gadget: fusb300_udc: free irq on the error path in fusb300_probe() | expand

Commit Message

Gaosheng Cui Nov. 20, 2022, 6:12 a.m. UTC
When request_irq(ires1->start) failed in w5300_hw_probe(), irq ires->start
has not been freed, and on the clean_up3 error path, we need to free
ires1->start irq, too. Fix it.

Fixes: 0fe6f1d1f612 ("usb: udc: add Faraday fusb300 driver")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
---
 drivers/usb/gadget/udc/fusb300_udc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/usb/gadget/udc/fusb300_udc.c b/drivers/usb/gadget/udc/fusb300_udc.c
index 9af8b415f303..c66a59c15003 100644
--- a/drivers/usb/gadget/udc/fusb300_udc.c
+++ b/drivers/usb/gadget/udc/fusb300_udc.c
@@ -1432,7 +1432,7 @@  static int fusb300_probe(struct platform_device *pdev)
 			IRQF_SHARED, udc_name, fusb300);
 	if (ret < 0) {
 		pr_err("request_irq1 error (%d)\n", ret);
-		goto clean_up;
+		goto clean_up2;
 	}
 
 	INIT_LIST_HEAD(&fusb300->gadget.ep_list);
@@ -1487,8 +1487,9 @@  static int fusb300_probe(struct platform_device *pdev)
 	fusb300_free_request(&fusb300->ep[0]->ep, fusb300->ep0_req);
 
 clean_up3:
+	free_irq(ires1->start, fusb300);
+clean_up2:
 	free_irq(ires->start, fusb300);
-
 clean_up:
 	if (fusb300) {
 		if (fusb300->ep0_req)