From 7d26b58735f5badf2b7ce3320c6ba21b603c77a9 Mon Sep 17 00:00:00 2001
From: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Date: Fri, 24 Feb 2012 17:32:14 -0800
Subject: [PATCH] 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>
---
 drivers/usb/dwc3/dwc3-pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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) {