linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: vt6655: Fix memory leak in vt6655_probe
@ 2019-10-04 20:03 Navid Emamdoost
  2019-10-05 16:30 ` Markus Elfring
  0 siblings, 1 reply; 4+ messages in thread
From: Navid Emamdoost @ 2019-10-04 20:03 UTC (permalink / raw)
  Cc: emamd001, kjlu, smccaman, Navid Emamdoost, Forest Bond,
	Greg Kroah-Hartman, Malcolm Priestley, Madhumitha Prabakaran,
	Luis Chamberlain, devel, linux-kernel

In vt6655_probe, if vnt_init() fails the cleanup code needs to be called
like other error handling cases. The call to device_free_info() is
added.

Fixes: 67013f2c0e58 ("staging: vt6655: mac80211 conversion add main mac80211 functions")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 drivers/staging/vt6655/device_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index c6bb4aaf9bd0..082302944c37 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1748,8 +1748,10 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
 
 	priv->hw->max_signal = 100;
 
-	if (vnt_init(priv))
+	if (vnt_init(priv)) {
+		device_free_info(priv);
 		return -ENODEV;
+	}
 
 	device_print_info(priv);
 	pci_set_drvdata(pcid, priv);
-- 
2.17.1


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

end of thread, other threads:[~2019-10-06  5:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-04 20:03 [PATCH] staging: vt6655: Fix memory leak in vt6655_probe Navid Emamdoost
2019-10-05 16:30 ` Markus Elfring
2019-10-05 18:40   ` Greg Kroah-Hartman
2019-10-06  5:39     ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).