mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Memory leak in e100
@ 2003-03-15  4:31 Henrik Thostrup Jensen
  0 siblings, 0 replies; 2+ messages in thread
From: Henrik Thostrup Jensen @ 2003-03-15  4:31 UTC (permalink / raw)
  To: scott.feldman, linux-kernel

Hi

This patch fixed a memory leak in the e100 driver.
Leak was catched by smatch.

Best regards, Henrik


Please cc, as I'm not subscribed.


diff -u -r1.35 e100_main.c
--- linux/drivers/net/e100/e100_main.c	3 Mar 2003 04:36:31 -0000
+++ linux/drivers/net/e100/e100_main.c	15 Mar 2003 03:07:31 -0000
@@ -3744,6 +3744,7 @@
 	char *strings = NULL;
 	char *usr_strings;
 	int i;
+	int rc = 0;
 
 	memset((void *) &info, 0, sizeof(info));
 
@@ -3784,14 +3785,19 @@
 		return -EOPNOTSUPP;
 	}
 
-	if (copy_to_user(ifr->ifr_data, &info, sizeof (info)))
-		return -EFAULT;
+	if (copy_to_user(ifr->ifr_data, &info, sizeof (info))) {
+		rc = -EFAULT;
+		goto exit3;
+	}
 
-	if (copy_to_user(usr_strings, strings, info.len * ETH_GSTRING_LEN))
-		return -EFAULT;
+	if (copy_to_user(usr_strings, strings, info.len * ETH_GSTRING_LEN)) {
+		rc = -EFAULT;
+		goto exit3;
+	}
 
+exit3:
 	kfree(strings);
-	return 0;
+	return rc;
 }
 
 static int

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

* RE: [PATCH] Memory leak in e100
@ 2003-03-17  3:30 Feldman, Scott
  0 siblings, 0 replies; 2+ messages in thread
From: Feldman, Scott @ 2003-03-17  3:30 UTC (permalink / raw)
  To: Henrik Thostrup Jensen, linux-kernel

> This patch fixed a memory leak in the e100 driver.
> Leak was catched by smatch.

Ack, thanks.

I'll add this to the other e100 patches I'm sending Jeff.

-scott

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

end of thread, other threads:[~2003-03-17  3:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-15  4:31 [PATCH] Memory leak in e100 Henrik Thostrup Jensen
2003-03-17  3:30 Feldman, Scott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®