Skip to content

Commit e55f3c3

Browse files
Dan Carpenterfelipebalbi
authored andcommitted
usb: gadget: udc: Potential Oops in error handling code
If this is in "transceiver" mode the the ->qwork isn't required and is a NULL pointer. This can lead to a NULL dereference when we call destroy_workqueue(udc->qwork). Fixes: 3517c31 ("usb: gadget: mv_udc: use devm_xxx for probe") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent d410912 commit e55f3c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/usb/gadget/udc/mv_udc_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2313,7 +2313,8 @@ static int mv_udc_probe(struct platform_device *pdev)
23132313
return 0;
23142314

23152315
err_create_workqueue:
2316-
destroy_workqueue(udc->qwork);
2316+
if (udc->qwork)
2317+
destroy_workqueue(udc->qwork);
23172318
err_destroy_dma:
23182319
dma_pool_destroy(udc->dtd_pool);
23192320
err_free_dma:

0 commit comments

Comments
 (0)