Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8313164c authored by wangweidong's avatar wangweidong Committed by Trond Myklebust
Browse files

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: default avatarWang Weidong <wangweidong1@huawei.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 6706246b
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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