Commit 9bbfceea authored by Navid Emamdoost's avatar Navid Emamdoost Committed by Felipe Balbi

usb: dwc3: pci: prevent memory leak in dwc3_pci_probe

In dwc3_pci_probe a call to platform_device_alloc allocates a device
which is correctly put in case of error except one case: when the call to
platform_device_add_properties fails it directly returns instead of
going to error handling. This commit replaces return with the goto.

Fixes: 1a7b12f6 ("usb: dwc3: pci: Supply device properties via driver data")
Signed-off-by: default avatarNavid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 1c20c89b
...@@ -258,7 +258,7 @@ static int dwc3_pci_probe(struct pci_dev *pci, const struct pci_device_id *id) ...@@ -258,7 +258,7 @@ static int dwc3_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
ret = platform_device_add_properties(dwc->dwc3, p); ret = platform_device_add_properties(dwc->dwc3, p);
if (ret < 0) if (ret < 0)
return ret; goto err;
ret = dwc3_pci_quirks(dwc); ret = dwc3_pci_quirks(dwc);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment