]> git.baikalelectronics.ru Git - kernel.git/commit
usb: ehci-sh: fix illegal phy_init() running when platform_data is NULL
authorShimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
Tue, 12 Jun 2012 00:34:33 +0000 (09:34 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Jun 2012 00:13:34 +0000 (17:13 -0700)
commit1f801d522fb5cbc4fcbd5160f97d56a0789df937
tree04b5b606356e6294f2471017498b80f33bce3627
parent9763170b95000810aeb6faf94b3103985b801d9a
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: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-sh.c