diff options
author | Peter Chen <[email protected]> | 2019-01-17 09:24:20 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2019-01-18 09:35:33 +0100 |
commit | 8ff396fe56f5593640a8ce7223cac33a2cda619e (patch) | |
tree | 9b3fa199793dd0236c2b5e4a0707ed9ef77114f9 | |
parent | a817c59e8273e555acb5cbccc75f5b57c27e3da9 (diff) |
usb: chipidea: fix static checker warning for NULL pointer
During the static checker, "data->usbmisc_data" may be NULL.
Fix it by adding this pointer judgement before using.
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Peter Chen <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_imx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index e81de9ca8729..9b45aa422e69 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -316,7 +316,8 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) if (IS_ERR(data->usbmisc_data)) return PTR_ERR(data->usbmisc_data); - if (of_usb_get_phy_mode(dev->of_node) == USBPHY_INTERFACE_MODE_HSIC) { + if ((of_usb_get_phy_mode(dev->of_node) == USBPHY_INTERFACE_MODE_HSIC) + && data->usbmisc_data) { pdata.flags |= CI_HDRC_IMX_IS_HSIC; data->usbmisc_data->hsic = 1; data->pinctrl = devm_pinctrl_get(dev); |