Patch "usb: cdns3: fix NULL pointer dereference on no platform data" has been added to the 5.10-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: cdns3: fix NULL pointer dereference on no platform data

to the 5.10-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-cdns3-fix-null-pointer-dereference-on-no-platfor.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 93073a4761da9d08ac6193b5cfb4b3e2723cea6d
Author: Roger Quadros <rogerq@xxxxxx>
Date:   Mon Nov 23 12:49:31 2020 +0200

    usb: cdns3: fix NULL pointer dereference on no platform data
    
    [ Upstream commit 448373d9db1a7000072f65103af19e20503f0c0c ]
    
    Some platforms (e.g. TI) will not have any platform data which will
    lead to NULL pointer dereference if we don't check for NULL pdata.
    
    Fixes: 7cea9657756b ("usb: cdns3: add quirk for enable runtime pm by default")
    Reported-by: Nishanth Menon <nm@xxxxxx>
    Signed-off-by: Roger Quadros <rogerq@xxxxxx>
    Acked-by: Pawel Laszczak <pawell@xxxxxxxxxxx>
    Signed-off-by: Peter Chen <peter.chen@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index 29affbf1e828..6eeb7ed8e91f 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -569,7 +569,7 @@ static int cdns3_probe(struct platform_device *pdev)
 	device_set_wakeup_capable(dev, true);
 	pm_runtime_set_active(dev);
 	pm_runtime_enable(dev);
-	if (!(cdns->pdata->quirks & CDNS3_DEFAULT_PM_RUNTIME_ALLOW))
+	if (!(cdns->pdata && (cdns->pdata->quirks & CDNS3_DEFAULT_PM_RUNTIME_ALLOW)))
 		pm_runtime_forbid(dev);
 
 	/*
diff --git a/drivers/usb/cdns3/host.c b/drivers/usb/cdns3/host.c
index c3b29a9c77a5..102977790d60 100644
--- a/drivers/usb/cdns3/host.c
+++ b/drivers/usb/cdns3/host.c
@@ -59,7 +59,7 @@ static int __cdns3_host_init(struct cdns3 *cdns)
 		goto err1;
 	}
 
-	if (cdns->pdata->quirks & CDNS3_DEFAULT_PM_RUNTIME_ALLOW)
+	if (cdns->pdata && (cdns->pdata->quirks & CDNS3_DEFAULT_PM_RUNTIME_ALLOW))
 		cdns->xhci_plat_data->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW;
 
 	ret = platform_device_add_data(xhci, cdns->xhci_plat_data,



[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