diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-02-01 02:46:20 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-02-06 18:47:59 -0500 |
commit | 87e3c0553fcbea79bf9f17fc5694484ecf3ae5e8 (patch) | |
tree | 7d0dcc070b4fdb9cbb7defa212feb4ba82519a26 /net/sunrpc/xprt.c | |
parent | b01dd1d8fae6178cbec374b90da2e4a3b8dce9ba (diff) |
SUNRPC: remove an unneeded NULL check in xprt_connect()
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>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r-- | net/sunrpc/xprt.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 839f6ef2326b..efe5495ecf65 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -715,9 +715,7 @@ void xprt_connect(struct rpc_task *task) | |||
715 | if (xprt_connected(xprt)) | 715 | if (xprt_connected(xprt)) |
716 | xprt_release_write(xprt, task); | 716 | xprt_release_write(xprt, task); |
717 | else { | 717 | else { |
718 | if (task->tk_rqstp) | 718 | task->tk_rqstp->rq_bytes_sent = 0; |
719 | task->tk_rqstp->rq_bytes_sent = 0; | ||
720 | |||
721 | task->tk_timeout = task->tk_rqstp->rq_timeout; | 719 | task->tk_timeout = task->tk_rqstp->rq_timeout; |
722 | rpc_sleep_on(&xprt->pending, task, xprt_connect_status); | 720 | rpc_sleep_on(&xprt->pending, task, xprt_connect_status); |
723 | 721 | ||