2008-04-08 20:16:07

by Chuck Lever III

[permalink] [raw]
Subject: [PATCH] SUNRPC: Fix memory leak introduced by commit 510deb0d

Commit 510deb0d was supposed to move the xprt_create_transport() call in
rpc_create(), but neglected to remove the old call site. This resulted in
a transport leak after every rpc_create() call.

This leak is present in 2.6.24 and 2.6.25.

Signed-off-by: Chuck Lever <[email protected]>
---

net/sunrpc/clnt.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index d0f04c8..dd39a39 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -260,10 +260,6 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
};
char servername[48];

- xprt = xprt_create_transport(&xprtargs);
- if (IS_ERR(xprt))
- return (struct rpc_clnt *)xprt;
-
/*
* If the caller chooses not to specify a hostname, whip
* up a string representation of the passed-in address.



2008-04-08 16:20:51

by Myklebust, Trond

[permalink] [raw]
Subject: Re: [PATCH] SUNRPC: Fix memory leak introduced by commit 510deb0d


On Tue, 2008-04-08 at 10:47 -0400, Chuck Lever wrote:
> Commit 510deb0d was supposed to move the xprt_create_transport() call in
> rpc_create(), but neglected to remove the old call site. This resulted in
> a transport leak after every rpc_create() call.
>
> This leak is present in 2.6.24 and 2.6.25.

Argh. I'll pass that on asap...

--
Trond Myklebust
Linux NFS client maintainer

NetApp
[email protected]
http://www.netapp.com