All of lore.kernel.org
 help / color / mirror / Atom feed
* [2.5] nfsd/export.c memleak.
@ 2003-03-11 14:58 Oleg Drokin
  2003-03-11 22:06 ` Neil Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Drokin @ 2003-03-11 14:58 UTC (permalink / raw)
  To: neilb, torvalds, linux-kernel

Hello!

     There is trivial memleak on error exit path in nfsd.
     See the patch below.
     Found with help of smatch + enhanced unfree script.

Bye,
    Oleg

===== fs/nfsd/export.c 1.71 vs edited =====
--- 1.71/fs/nfsd/export.c	Tue Feb 25 13:08:50 2003
+++ edited/fs/nfsd/export.c	Tue Mar 11 17:55:18 2003
@@ -294,7 +294,10 @@
 
 	/* client */
 	len = qword_get(&mesg, buf, PAGE_SIZE);
-	if (len <= 0) return -EINVAL;
+	if (len <= 0) {
+		err = -EINVAL;
+		goto out;
+	}
 	err = -ENOENT;
 	dom = auth_domain_find(buf);
 	if (!dom)

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

* Re: [2.5] nfsd/export.c memleak.
  2003-03-11 14:58 [2.5] nfsd/export.c memleak Oleg Drokin
@ 2003-03-11 22:06 ` Neil Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Brown @ 2003-03-11 22:06 UTC (permalink / raw)
  To: Oleg Drokin; +Cc: linux-kernel

On Tuesday March 11, green@namesys.com wrote:
> Hello!
> 
>      There is trivial memleak on error exit path in nfsd.
>      See the patch below.
>      Found with help of smatch + enhanced unfree script.

Thanks to all threee of you?
However in keeping with the style of surrounding code I will make it:


===== fs/nfsd/export.c 1.71 vs edited =====
--- 1.71/fs/nfsd/export.c	Tue Feb 25 13:08:50 2003
+++ edited/fs/nfsd/export.c	Tue Mar 11 17:55:18 2003
@@ -294,7 +294,10 @@
 
 	/* client */
 	len = qword_get(&mesg, buf, PAGE_SIZE);
-	if (len <= 0) return -EINVAL;
+	err = -EINVAL;
+	if (len <= 0)
+		goto out;
+	
 	err = -ENOENT;
 	dom = auth_domain_find(buf);
 	if (!dom)

NeilBrown

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

end of thread, other threads:[~2003-03-11 21:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-11 14:58 [2.5] nfsd/export.c memleak Oleg Drokin
2003-03-11 22:06 ` Neil Brown

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.