SUNRPC: remove an unnecessary if statement
authorwangweidong <wangweidong1@huawei.com>
Tue, 15 Oct 2013 03:44:30 +0000 (11:44 +0800)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 28 Oct 2013 22:16:56 +0000 (18:16 -0400)
If req allocated failed just goto out_free, no need to check the
'i < num_prealloc'. There is just code simplification, no
functional changes.

Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/xprt.c

index 4953550537e0d6284625d39bf46992a792966ace..04199bc8416f0c3bd3add838381db36f12130144 100644 (file)
@@ -1104,11 +1104,9 @@ struct rpc_xprt *xprt_alloc(struct net *net, size_t size,
        for (i = 0; i < num_prealloc; i++) {
                req = kzalloc(sizeof(struct rpc_rqst), GFP_KERNEL);
                if (!req)
-                       break;
+                       goto out_free;
                list_add(&req->rq_list, &xprt->free);
        }
-       if (i < num_prealloc)
-               goto out_free;
        if (max_alloc > num_prealloc)
                xprt->max_reqs = max_alloc;
        else