diff options
author | Paul Zimmerman <Paul.Zimmerman@synopsys.com> | 2012-02-24 17:32:14 -0800 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-03-02 12:12:07 +0200 |
commit | 7d26b58735f5badf2b7ce3320c6ba21b603c77a9 (patch) | |
tree | f19c51cb50c20c8111feed608d170478b7cec3f1 /drivers/usb/dwc3 | |
parent | 3e87c42a29f14c7a346f912e084f6ab13ea8288b (diff) | |
download | linux-stable-7d26b58735f5badf2b7ce3320c6ba21b603c77a9.tar.gz linux-stable-7d26b58735f5badf2b7ce3320c6ba21b603c77a9.tar.bz2 linux-stable-7d26b58735f5badf2b7ce3320c6ba21b603c77a9.zip |
usb: dwc3: pci: fix failure path in dwc3_pci_probe()
dwc3_pci_probe() would return success even if the calls to
dwc3_get_device_id() or platform_device_alloc() fail, fix that.
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r-- | drivers/usb/dwc3/dwc3-pci.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 74bac06652c4..dcc64791b4e1 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -81,8 +81,10 @@ static int __devinit dwc3_pci_probe(struct pci_dev *pci, pci_set_master(pci); devid = dwc3_get_device_id(); - if (devid < 0) + if (devid < 0) { + ret = -ENOMEM; goto err1; + } dwc3 = platform_device_alloc("dwc3", devid); if (!dwc3) { |