Skip to content

Commit

Permalink
SUNRPC: remove an unneeded NULL check in xprt_connect()
Browse files Browse the repository at this point in the history
We check "task->tk_rqstp" and then we dereference it without checking on
the next line.  The only caller is call_connect() and that has a check
which prevents it from calling xprt_connect() with a NULL.

                if (task->tk_status < 0)
                        return;

If "task->tk_rqstp" were NULL then "tk_status" would be -EAGAIN.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Dan Carpenter authored and Trond Myklebust committed Feb 6, 2012
1 parent b01dd1d commit 87e3c05
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/sunrpc/xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,9 +715,7 @@ void xprt_connect(struct rpc_task *task)
if (xprt_connected(xprt))
xprt_release_write(xprt, task);
else {
if (task->tk_rqstp)
task->tk_rqstp->rq_bytes_sent = 0;

task->tk_rqstp->rq_bytes_sent = 0;
task->tk_timeout = task->tk_rqstp->rq_timeout;
rpc_sleep_on(&xprt->pending, task, xprt_connect_status);

Expand Down

0 comments on commit 87e3c05

Please sign in to comment.