Commit 2d461f64 authored by Dan Carpenter's avatar Dan Carpenter Committed by Kelsey Skunberg

usb: gadget: udc: Potential Oops in error handling code

BugLink: https://bugs.launchpad.net/bugs/1885932

[ Upstream commit e55f3c37 ]

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: 3517c31a ("usb: gadget: mv_udc: use devm_xxx for probe")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent 50211e77
......@@ -2322,7 +2322,8 @@ static int mv_udc_probe(struct platform_device *pdev)
return 0;
err_create_workqueue:
destroy_workqueue(udc->qwork);
if (udc->qwork)
destroy_workqueue(udc->qwork);
err_destroy_dma:
dma_pool_destroy(udc->dtd_pool);
err_free_dma:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment