Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5034b1fd authored by Dan Carpenter's avatar Dan Carpenter Committed by Sasha Levin
Browse files

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



[ Upstream commit e55f3c37cb8d31c7e301f46396b2ac6a19eb3a7c ]

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>
parent f5e4ce48
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2313,6 +2313,7 @@ static int mv_udc_probe(struct platform_device *pdev)
	return 0;

err_create_workqueue:
	if (udc->qwork)
		destroy_workqueue(udc->qwork);
err_destroy_dma:
	dma_pool_destroy(udc->dtd_pool);