Commit 610a0848 authored by Trond Myklebust's avatar Trond Myklebust Committed by Greg Kroah-Hartman

NLM: Fix double free in __nlm_async_call

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=7923Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
Cc: Jan "Yenya" Kasprzak <kas@fi.muni.cz>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent af2fec73
...@@ -361,7 +361,6 @@ static int __nlm_async_call(struct nlm_rqst *req, u32 proc, struct rpc_message * ...@@ -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 nlm_host *host = req->a_host;
struct rpc_clnt *clnt; struct rpc_clnt *clnt;
int status = -ENOLCK;
dprintk("lockd: call procedure %d on %s (async)\n", dprintk("lockd: call procedure %d on %s (async)\n",
(int)proc, host->h_name); (int)proc, host->h_name);
...@@ -373,12 +372,10 @@ static int __nlm_async_call(struct nlm_rqst *req, u32 proc, struct rpc_message * ...@@ -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]; msg->rpc_proc = &clnt->cl_procinfo[proc];
/* bootstrap and kick off the async RPC call */ /* bootstrap and kick off the async RPC call */
status = rpc_call_async(clnt, msg, RPC_TASK_ASYNC, tk_ops, req); return rpc_call_async(clnt, msg, RPC_TASK_ASYNC, tk_ops, req);
if (status == 0)
return 0;
out_err: out_err:
nlm_release_call(req); tk_ops->rpc_release(req);
return status; return -ENOLCK;
} }
int nlm_async_call(struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops) int nlm_async_call(struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops)
......
...@@ -593,9 +593,7 @@ nlmsvc_grant_blocked(struct nlm_block *block) ...@@ -593,9 +593,7 @@ nlmsvc_grant_blocked(struct nlm_block *block)
/* Call the client */ /* Call the client */
kref_get(&block->b_count); kref_get(&block->b_count);
if (nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG, nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG, &nlmsvc_grant_ops);
&nlmsvc_grant_ops) < 0)
nlmsvc_release_block(block);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment