Skip to content

Commit

Permalink
SUNRPC: remove an unnecessary if statement
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
wangweidong authored and Trond Myklebust committed Oct 28, 2013
1 parent 6706246 commit 8313164
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/sunrpc/xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8313164

Please sign in to comment.