]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.36/usb-dwc3-pci-properly-cleanup-resource.patch
Drop nfc patches from older trees
[thirdparty/kernel/stable-queue.git] / releases / 4.14.36 / usb-dwc3-pci-properly-cleanup-resource.patch
CommitLineData
33d0fbc2
GKH
1From cabdf83dadfb3d83eec31e0f0638a92dbd716435 Mon Sep 17 00:00:00 2001
2From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
3Date: Mon, 19 Mar 2018 13:07:35 -0700
4Subject: usb: dwc3: pci: Properly cleanup resource
5
6From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
7
8commit cabdf83dadfb3d83eec31e0f0638a92dbd716435 upstream.
9
10Platform device is allocated before adding resources. Make sure to
11properly cleanup on error case.
12
13Cc: <stable@vger.kernel.org>
14Fixes: f1c7e7108109 ("usb: dwc3: convert to pcim_enable_device()")
15Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
16Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
17Signed-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;