diff options
| author | Roger Quadros <[email protected]> | 2020-11-23 10:49:31 +0000 |
|---|---|---|
| committer | Peter Chen <[email protected]> | 2020-12-10 09:35:33 +0000 |
| commit | 448373d9db1a7000072f65103af19e20503f0c0c (patch) | |
| tree | d9425607d95850f22d056d262ab41b537f60502e /drivers/usb/cdns3/core.c | |
| parent | usb: chipidea: trace: fix the endian issue (diff) | |
| download | kernel-448373d9db1a7000072f65103af19e20503f0c0c.tar.gz kernel-448373d9db1a7000072f65103af19e20503f0c0c.zip | |
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 <[email protected]>
Signed-off-by: Roger Quadros <[email protected]>
Acked-by: Pawel Laszczak <[email protected]>
Signed-off-by: Peter Chen <[email protected]>
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); /* |
