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>
This commit is contained in:
		
					parent
					
						
							
								3e87c42a29
							
						
					
				
			
			
				commit
				
					
						7d26b58735
					
				
			
		
					 1 changed files with 3 additions and 1 deletions
				
			
		|  | @ -81,8 +81,10 @@ static int __devinit dwc3_pci_probe(struct pci_dev *pci, | ||||||
| 	pci_set_master(pci); | 	pci_set_master(pci); | ||||||
| 
 | 
 | ||||||
| 	devid = dwc3_get_device_id(); | 	devid = dwc3_get_device_id(); | ||||||
| 	if (devid < 0) | 	if (devid < 0) { | ||||||
|  | 		ret = -ENOMEM; | ||||||
| 		goto err1; | 		goto err1; | ||||||
|  | 	} | ||||||
| 
 | 
 | ||||||
| 	dwc3 = platform_device_alloc("dwc3", devid); | 	dwc3 = platform_device_alloc("dwc3", devid); | ||||||
| 	if (!dwc3) { | 	if (!dwc3) { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Paul Zimmerman
				Paul Zimmerman