Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cabdf83d authored by Thinh Nguyen's avatar Thinh Nguyen Committed by Felipe Balbi
Browse files

usb: dwc3: pci: Properly cleanup resource



Platform device is allocated before adding resources. Make sure to
properly cleanup on error case.

Cc: <stable@vger.kernel.org>
Fixes: f1c7e710 ("usb: dwc3: convert to pcim_enable_device()")
Signed-off-by: default avatarThinh Nguyen <thinhn@synopsys.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent de948a74
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -222,7 +222,7 @@ static int dwc3_pci_probe(struct pci_dev *pci,
	ret = platform_device_add_resources(dwc->dwc3, res, ARRAY_SIZE(res));
	ret = platform_device_add_resources(dwc->dwc3, res, ARRAY_SIZE(res));
	if (ret) {
	if (ret) {
		dev_err(dev, "couldn't add resources to dwc3 device\n");
		dev_err(dev, "couldn't add resources to dwc3 device\n");
		return ret;
		goto err;
	}
	}


	dwc->pci = pci;
	dwc->pci = pci;