SUNRPC: Fix a memory leak in rpcb_getport_async
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 3 Oct 2008 20:48:40 +0000 (16:48 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Feb 2009 16:28:11 +0000 (08:28 -0800)
commit 96165e2b7c4e2c82a0b60c766d4a2036444c21a0 upstream.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/sunrpc/rpcb_clnt.c

index 24db2b4..fce0547 100644 (file)
@@ -558,7 +558,7 @@ void rpcb_getport_async(struct rpc_task *task)
                status = -ENOMEM;
                dprintk("RPC: %5u %s: no memory available\n",
                        task->tk_pid, __func__);
-               goto bailout_nofree;
+               goto bailout_release_client;
        }
        map->r_prog = clnt->cl_prog;
        map->r_vers = clnt->cl_vers;
@@ -583,6 +583,8 @@ void rpcb_getport_async(struct rpc_task *task)
        task->tk_xprt->stat.bind_count++;
        return;
 
+bailout_release_client:
+       rpc_release_client(rpcb_clnt);
 bailout_nofree:
        rpcb_wake_rpcbind_waiters(xprt, status);
        task->tk_status = status;