diff options
author | Roger Quadros <rogerq@ti.com> | 2020-11-23 12:49:31 +0200 |
---|---|---|
committer | Peter Chen <peter.chen@nxp.com> | 2020-12-10 17:35:33 +0800 |
commit | 448373d9db1a7000072f65103af19e20503f0c0c (patch) | |
tree | d9425607d95850f22d056d262ab41b537f60502e /drivers/usb/cdns3/core.c | |
parent | 429ad75f2b13ac8a2c7af859f8f61b9188bca7ba (diff) | |
download | linux-448373d9db1a7000072f65103af19e20503f0c0c.tar.bz2 |
usb: cdns3: fix NULL pointer dereference on no platform data
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@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb/cdns3/core.c')
-rw-r--r-- | drivers/usb/cdns3/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index 54d841aa626f..0f08aebce86d 100644 --- a/drivers/usb/cdns3/core.c +++ b/drivers/usb/cdns3/core.c @@ -559,7 +559,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); /* |