Patch "usb: gadget: udc: Potential Oops in error handling code" has been added to the 4.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

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

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-gadget-udc-potential-oops-in-error-handling-code.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 888cfdcca44bab6cbb52f82949b2841a6f43e04a
Author: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date:   Mon Jun 15 14:27:19 2020 +0300

    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: 3517c31a8ece ("usb: gadget: mv_udc: use devm_xxx for probe")
    Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Signed-off-by: Felipe Balbi <balbi@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/drivers/usb/gadget/udc/mv_udc_core.c
index ce73b3552269f..8700db903382d 100644
--- a/drivers/usb/gadget/udc/mv_udc_core.c
+++ b/drivers/usb/gadget/udc/mv_udc_core.c
@@ -2317,7 +2317,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:



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux