aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2016-02-06 22:57:06 +0800
committerPeter Chen <peter.chen@nxp.com>2016-02-19 14:13:44 +0800
commit8c0614ca312c847ca5409ea11c39434dec69631d (patch)
tree265a5a72c97177b2e8b18d0a62601dab5f380b70 /drivers/usb
parentusb: chipidea: error on overflow for port_test_write (diff)
downloadlinux-dev-8c0614ca312c847ca5409ea11c39434dec69631d.tar.xz
linux-dev-8c0614ca312c847ca5409ea11c39434dec69631d.zip
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/chipidea/ci_hdrc_pci.c4
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,
/* register a nop PHY */
ci->phy = usb_phy_generic_register();
- if (!ci->phy)
- return -ENOMEM;
+ if (IS_ERR(ci->phy))
+ return PTR_ERR(ci->phy);
memset(res, 0, sizeof(res));
res[0].start = pci_resource_start(pdev, 0);