From 87e3c0553fcbea79bf9f17fc5694484ecf3ae5e8 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 1 Feb 2012 10:46:20 +0300 Subject: 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 Signed-off-by: Trond Myklebust --- net/sunrpc/xprt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'net/sunrpc/xprt.c') 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) 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); -- cgit v1.2.3-59-g8ed1b