]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
NLM: Fix double free in __nlm_async_call
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 5 Feb 2007 20:33:23 +0000 (12:33 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 9 Mar 2007 18:50:29 +0000 (10:50 -0800)
rpc_call_async() will always call rpc_release_calldata(), so it is an
error for __nlm_async_call() to do so as well.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=7923

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Jan "Yenya" Kasprzak <kas@fi.muni.cz>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/lockd/clntproc.c
fs/lockd/svclock.c

index 0b4acc1c5e7da2a87a4f626f957b913dae5faff3..a5c019e1a44762bb63601accb17bb6b7a2671552 100644 (file)
@@ -361,7 +361,6 @@ static int __nlm_async_call(struct nlm_rqst *req, u32 proc, struct rpc_message *
 {
        struct nlm_host *host = req->a_host;
        struct rpc_clnt *clnt;
-       int status = -ENOLCK;
 
        dprintk("lockd: call procedure %d on %s (async)\n",
                        (int)proc, host->h_name);
@@ -373,12 +372,10 @@ static int __nlm_async_call(struct nlm_rqst *req, u32 proc, struct rpc_message *
        msg->rpc_proc = &clnt->cl_procinfo[proc];
 
         /* bootstrap and kick off the async RPC call */
-        status = rpc_call_async(clnt, msg, RPC_TASK_ASYNC, tk_ops, req);
-       if (status == 0)
-               return 0;
+        return rpc_call_async(clnt, msg, RPC_TASK_ASYNC, tk_ops, req);
 out_err:
-       nlm_release_call(req);
-       return status;
+       tk_ops->rpc_release(req);
+       return -ENOLCK;
 }
 
 int nlm_async_call(struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops)
index c7db0a5bccdc19bcff9134efe7df604e55cdab22..cf51f849e76c86732af645b5ab79ea12a002b021 100644 (file)
@@ -593,9 +593,7 @@ callback:
 
        /* Call the client */
        kref_get(&block->b_count);
-       if (nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG,
-                                               &nlmsvc_grant_ops) < 0)
-               nlmsvc_release_block(block);
+       nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG, &nlmsvc_grant_ops);
 }
 
 /*