Skip to content

Commit

Permalink
usb: dwc3: pci: prevent memory leak in dwc3_pci_probe
Browse files Browse the repository at this point in the history
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: 1a7b12f ("usb: dwc3: pci: Supply device properties via driver data")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
  • Loading branch information
Navidem authored and felipebalbi committed Oct 27, 2019
1 parent 1c20c89 commit 9bbfcee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/dwc3/dwc3-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
if (ret < 0)
return ret;
goto err;

ret = dwc3_pci_quirks(dwc);
if (ret)
Expand Down

0 comments on commit 9bbfcee

Please sign in to comment.