diff options
author | Paul Zimmerman | 2012-02-25 02:32:14 +0100 |
---|---|---|
committer | Felipe Balbi | 2012-03-02 11:12:07 +0100 |
commit | 7d26b58735f5badf2b7ce3320c6ba21b603c77a9 (patch) | |
tree | f19c51cb50c20c8111feed608d170478b7cec3f1 /drivers/usb/dwc3 | |
parent | usb: dwc3: replace hard-coded constant in DWC3_GCTL_SCALEDOWN(3) (diff) | |
download | kernel-qcow2-linux-7d26b58735f5badf2b7ce3320c6ba21b603c77a9.tar.gz kernel-qcow2-linux-7d26b58735f5badf2b7ce3320c6ba21b603c77a9.tar.xz kernel-qcow2-linux-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) { |