aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorwangweidong <wangweidong1@huawei.com>2013-10-14 23:44:30 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-10-28 18:16:56 -0400
commit8313164c36473193c8034de643dc32f35a22bf59 (patch)
treec900e38098f5985b64056dad222cc6f1bc80c333 /net
parent6706246b22358b70b49e35a988a9bbfa830619ee (diff)
SUNRPC: remove an unnecessary if statement
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>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/xprt.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 4953550537e0..04199bc8416f 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -1104,11 +1104,9 @@ struct rpc_xprt *xprt_alloc(struct net *net, size_t size,
1104 for (i = 0; i < num_prealloc; i++) { 1104 for (i = 0; i < num_prealloc; i++) {
1105 req = kzalloc(sizeof(struct rpc_rqst), GFP_KERNEL); 1105 req = kzalloc(sizeof(struct rpc_rqst), GFP_KERNEL);
1106 if (!req) 1106 if (!req)
1107 break; 1107 goto out_free;
1108 list_add(&req->rq_list, &xprt->free); 1108 list_add(&req->rq_list, &xprt->free);
1109 } 1109 }
1110 if (i < num_prealloc)
1111 goto out_free;
1112 if (max_alloc > num_prealloc) 1110 if (max_alloc > num_prealloc)
1113 xprt->max_reqs = max_alloc; 1111 xprt->max_reqs = max_alloc;
1114 else 1112 else