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

Commit 5897b038 authored by Shimoda, Yoshihiro's avatar Shimoda, Yoshihiro Committed by Greg Kroah-Hartman
Browse files

usb: ehci-sh: fix illegal phy_init() running when platform_data is NULL



If the platform_data is not set, pdata will be uninitialized value.
Since the driver has the following code, if the condition is true when
the pdata is uninitialized value, the driver may jump to the illegal
phy_init().

	if (pdata && pdata->phy_init)
		pdata->phy_init();

This patch also fixes the following warning:

  CC      drivers/usb/host/ehci-hcd.o
drivers/usb/host/ehci-sh.c: In function ‘ehci_hcd_sh_probe’:
drivers/usb/host/ehci-sh.c:104: warning: ‘pdata’ may be used uninitialized in this function

Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6c4707f3
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -126,7 +126,6 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)
		goto fail_create_hcd;
	}

	if (pdev->dev.platform_data != NULL)
	pdata = pdev->dev.platform_data;

	/* initialize hcd */