All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: pci: prevent memory leak in dwc3_pci_probe
@ 2019-09-30  2:41 Navid Emamdoost
  2019-09-30  6:55   ` Markus Elfring
  0 siblings, 1 reply; 3+ messages in thread
From: Navid Emamdoost @ 2019-09-30  2:41 UTC (permalink / raw)
  Cc: emamd001, kjlu, smccaman, Navid Emamdoost, Felipe Balbi,
	Greg Kroah-Hartman, linux-usb, linux-kernel

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 <navid.emamdoost@gmail.com>
---
 drivers/usb/dwc3/dwc3-pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 5e8e18222f92..023f0357efd7 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -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)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: dwc3: pci: prevent memory leak in dwc3_pci_probe
  2019-09-30  2:41 [PATCH] usb: dwc3: pci: prevent memory leak in dwc3_pci_probe Navid Emamdoost
@ 2019-09-30  6:55   ` Markus Elfring
  0 siblings, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2019-09-30  6:55 UTC (permalink / raw)
  To: Navid Emamdoost, linux-usb
  Cc: Navid Emamdoost, Kangjie Lu, Stephen McCamant, Felipe Balbi,
	Greg Kroah-Hartman, linux-kernel, kernel-janitors

> … 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: dwc3: pci: prevent memory leak in dwc3_pci_probe
@ 2019-09-30  6:55   ` Markus Elfring
  0 siblings, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2019-09-30  6:55 UTC (permalink / raw)
  To: Navid Emamdoost, linux-usb
  Cc: Navid Emamdoost, Kangjie Lu, Stephen McCamant, Felipe Balbi,
	Greg Kroah-Hartman, linux-kernel, kernel-janitors

> … 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-30  6:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-30  2:41 [PATCH] usb: dwc3: pci: prevent memory leak in dwc3_pci_probe Navid Emamdoost
2019-09-30  6:55 ` Markus Elfring
2019-09-30  6:55   ` Markus Elfring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.