usb: dwc3: pci: prevent memory leak in dwc3_pci_probe
Subsystems (3)
PATCH 1/1 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 1a7b12f69a94 ("usb: dwc3: pci: Supply device properties via driver data")
Signed-off-by Navid Emamdoost <[email protected]>
--- drivers/usb/dwc3/dwc3-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/dwc3/dwc3-pci.c +1 -1
@@ -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)
Signature · 1 line
2.17.1
Quoted 1 line
… This commit replaces return with the goto.
How do you think about to omit the wording “This commit” from your change descriptions?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=97f9a3c4eee55b0178b518ae7114a6a53372913d#n151
Regards,
Markus