Unverified Commit be9de0f7 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4931 phy: ti: phy-omap-usb2: Fix NULL pointer dereference for SRP

parents b4ee7fc4 7b9cb403
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ static int omap_usb_set_vbus(struct usb_otg *otg, bool enabled)
{
	struct omap_usb *phy = phy_to_omapusb(otg->usb_phy);

	if (!phy->comparator)
	if (!phy->comparator || !phy->comparator->set_vbus)
		return -ENODEV;

	return phy->comparator->set_vbus(phy->comparator, enabled);
@@ -126,7 +126,7 @@ static int omap_usb_start_srp(struct usb_otg *otg)
{
	struct omap_usb *phy = phy_to_omapusb(otg->usb_phy);

	if (!phy->comparator)
	if (!phy->comparator || !phy->comparator->start_srp)
		return -ENODEV;

	return phy->comparator->start_srp(phy->comparator);