aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-02-03 16:38:40 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-02-03 18:35:02 -0500
commit54cc533aaa0dc331ad126f0aacfb19572adee638 (patch)
tree45bb1bb889fc26a94931bc09319625f10cb80d39 /net/sunrpc
parenta995e9eb3258df6ab2e9f958e08003978e50d568 (diff)
RPC: Fix double free in portmapper code
rpc_run_task is guaranteed to always call ->rpc_release. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/pmap_clnt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/sunrpc/pmap_clnt.c b/net/sunrpc/pmap_clnt.c
index 3946ec3eb517..76e59e9b8fb8 100644
--- a/net/sunrpc/pmap_clnt.c
+++ b/net/sunrpc/pmap_clnt.c
@@ -62,7 +62,10 @@ static inline void pmap_map_free(struct portmap_args *map)
62 62
63static void pmap_map_release(void *data) 63static void pmap_map_release(void *data)
64{ 64{
65 pmap_map_free(data); 65 struct portmap_args *map = data;
66
67 xprt_put(map->pm_xprt);
68 pmap_map_free(map);
66} 69}
67 70
68static const struct rpc_call_ops pmap_getport_ops = { 71static const struct rpc_call_ops pmap_getport_ops = {
@@ -133,7 +136,7 @@ void rpc_getport(struct rpc_task *task)
133 status = -EIO; 136 status = -EIO;
134 child = rpc_run_task(pmap_clnt, RPC_TASK_ASYNC, &pmap_getport_ops, map); 137 child = rpc_run_task(pmap_clnt, RPC_TASK_ASYNC, &pmap_getport_ops, map);
135 if (IS_ERR(child)) 138 if (IS_ERR(child))
136 goto bailout; 139 goto bailout_nofree;
137 rpc_put_task(child); 140 rpc_put_task(child);
138 141
139 task->tk_xprt->stat.bind_count++; 142 task->tk_xprt->stat.bind_count++;
@@ -222,7 +225,6 @@ static void pmap_getport_done(struct rpc_task *child, void *data)
222 child->tk_pid, status, map->pm_port); 225 child->tk_pid, status, map->pm_port);
223 226
224 pmap_wake_portmap_waiters(xprt, status); 227 pmap_wake_portmap_waiters(xprt, status);
225 xprt_put(xprt);
226} 228}
227 229
228/** 230/**