Skip to content

Commit 8c0614c

Browse files
Wei YongjunPeter Chen
authored andcommitted
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 <[email protected]> Signed-off-by: Peter Chen <[email protected]>
1 parent a4de018 commit 8c0614c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/chipidea/ci_hdrc_pci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ static int ci_hdrc_pci_probe(struct pci_dev *pdev,
8585

8686
/* register a nop PHY */
8787
ci->phy = usb_phy_generic_register();
88-
if (!ci->phy)
89-
return -ENOMEM;
88+
if (IS_ERR(ci->phy))
89+
return PTR_ERR(ci->phy);
9090

9191
memset(res, 0, sizeof(res));
9292
res[0].start = pci_resource_start(pdev, 0);

0 commit comments

Comments
 (0)