From: Wei Yongjun Date: Sat, 6 Feb 2016 14:57:06 +0000 (+0800) Subject: usb: chipidea: fix return value check in ci_hdrc_pci_probe() X-Git-Tag: v4.5-rc6~6^2~3^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8c0614ca312c847ca5409ea11c39434dec69631d;p=karo-tx-linux.git 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 Signed-off-by: Peter Chen --- 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);