xprt: remove redundant null check
authorj223yang@asset.uwaterloo.ca <j223yang@asset.uwaterloo.ca>
Thu, 10 Mar 2011 17:40:28 +0000 (12:40 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 16 Mar 2011 00:16:14 +0000 (20:16 -0400)
'req' is dereferenced before checked for NULL.
The patch simply removes the check.

Signed-off-by: Jinqiu Yang<crindy646@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/xprt.c

index 856274d..8bdcdbe 100644 (file)
@@ -202,10 +202,9 @@ int xprt_reserve_xprt(struct rpc_task *task)
                goto out_sleep;
        }
        xprt->snd_task = task;
-       if (req) {
-               req->rq_bytes_sent = 0;
-               req->rq_ntrans++;
-       }
+       req->rq_bytes_sent = 0;
+       req->rq_ntrans++;
+
        return 1;
 
 out_sleep: