From: Paul Zimmerman Date: Sat, 25 Feb 2012 01:32:14 +0000 (-0800) Subject: usb: dwc3: pci: fix failure path in dwc3_pci_probe() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7d26b58;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 Signed-off-by: Felipe Balbi --- 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) {