diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2016-02-06 09:57:06 -0500 |
---|---|---|
committer | Peter Chen <peter.chen@nxp.com> | 2016-02-19 01:13:44 -0500 |
commit | 8c0614ca312c847ca5409ea11c39434dec69631d (patch) | |
tree | 265a5a72c97177b2e8b18d0a62601dab5f380b70 | |
parent | a4de018d2b0364e40a626fa521ec21e31a10ac84 (diff) |
usb: chipidea: fix return value check in ci_hdrc_pci_probe()
In case of error, the function usb_phy_generic_register()
returns ERR_PTR() and never returns NULL. The NULL test in
the return value check should be replaced with IS_ERR().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_pci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_pci.c b/drivers/usb/chipidea/ci_hdrc_pci.c index b59195edf636..b635ab67490d 100644 --- a/drivers/usb/chipidea/ci_hdrc_pci.c +++ b/drivers/usb/chipidea/ci_hdrc_pci.c | |||
@@ -85,8 +85,8 @@ static int ci_hdrc_pci_probe(struct pci_dev *pdev, | |||
85 | 85 | ||
86 | /* register a nop PHY */ | 86 | /* register a nop PHY */ |
87 | ci->phy = usb_phy_generic_register(); | 87 | ci->phy = usb_phy_generic_register(); |
88 | if (!ci->phy) | 88 | if (IS_ERR(ci->phy)) |
89 | return -ENOMEM; | 89 | return PTR_ERR(ci->phy); |
90 | 90 | ||
91 | memset(res, 0, sizeof(res)); | 91 | memset(res, 0, sizeof(res)); |
92 | res[0].start = pci_resource_start(pdev, 0); | 92 | res[0].start = pci_resource_start(pdev, 0); |