Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97b9b7dc authored by Vladimir Zapolskiy's avatar Vladimir Zapolskiy Committed by Greg Kroah-Hartman
Browse files

usb: musb: jz4740: fix error check of usb_get_phy()



The usb_get_phy() function returns either a valid pointer to phy or
ERR_PTR() error, check for NULL always fails and may lead to oops on
error path, fix this issue.

Signed-off-by: default avatarVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: default avatarBin Liu <b-liu@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f551e135
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -83,9 +83,9 @@ static int jz4740_musb_init(struct musb *musb)
{
	usb_phy_generic_register();
	musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
	if (!musb->xceiv) {
	if (IS_ERR(musb->xceiv)) {
		pr_err("HS UDC: no transceiver configured\n");
		return -ENODEV;
		return PTR_ERR(musb->xceiv);
	}

	/* Silicon does not implement ConfigData register.