Skip to content

Commit

Permalink
SUNRPC: Fix an RCU dereference in xprt_reserve
Browse files Browse the repository at this point in the history
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Feb 1, 2013
1 parent 6a24dfb commit 45bc0dc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/sunrpc/xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,15 +1093,18 @@ EXPORT_SYMBOL_GPL(xprt_free);
*/
void xprt_reserve(struct rpc_task *task)
{
struct rpc_xprt *xprt = task->tk_xprt;
struct rpc_xprt *xprt;

task->tk_status = 0;
if (task->tk_rqstp != NULL)
return;

task->tk_timeout = 0;
task->tk_status = -EAGAIN;
rcu_read_lock();
xprt = rcu_dereference(task->tk_client->cl_xprt);
xprt->ops->alloc_slot(xprt, task);
rcu_read_unlock();
}

static inline __be32 xprt_alloc_xid(struct rpc_xprt *xprt)
Expand Down

0 comments on commit 45bc0dc

Please sign in to comment.