]>
Commit | Line | Data |
---|---|---|
33d0fbc2 GKH |
1 | From cabdf83dadfb3d83eec31e0f0638a92dbd716435 Mon Sep 17 00:00:00 2001 |
2 | From: Thinh Nguyen <Thinh.Nguyen@synopsys.com> | |
3 | Date: Mon, 19 Mar 2018 13:07:35 -0700 | |
4 | Subject: usb: dwc3: pci: Properly cleanup resource | |
5 | ||
6 | From: Thinh Nguyen <Thinh.Nguyen@synopsys.com> | |
7 | ||
8 | commit cabdf83dadfb3d83eec31e0f0638a92dbd716435 upstream. | |
9 | ||
10 | Platform device is allocated before adding resources. Make sure to | |
11 | properly cleanup on error case. | |
12 | ||
13 | Cc: <stable@vger.kernel.org> | |
14 | Fixes: f1c7e7108109 ("usb: dwc3: convert to pcim_enable_device()") | |
15 | Signed-off-by: Thinh Nguyen <thinhn@synopsys.com> | |
16 | Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> | |
17 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
18 | ||
19 | --- | |
20 | drivers/usb/dwc3/dwc3-pci.c | 2 +- | |
21 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
22 | ||
23 | --- a/drivers/usb/dwc3/dwc3-pci.c | |
24 | +++ b/drivers/usb/dwc3/dwc3-pci.c | |
25 | @@ -212,7 +212,7 @@ static int dwc3_pci_probe(struct pci_dev | |
26 | ret = platform_device_add_resources(dwc->dwc3, res, ARRAY_SIZE(res)); | |
27 | if (ret) { | |
28 | dev_err(dev, "couldn't add resources to dwc3 device\n"); | |
29 | - return ret; | |
30 | + goto err; | |
31 | } | |
32 | ||
33 | dwc->pci = pci; |