Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

wangweidong and committed by
Trond Myklebust
8313164c 6706246b

+1 -3
+1 -3
net/sunrpc/xprt.c
··· 1104 1104 for (i = 0; i < num_prealloc; i++) { 1105 1105 req = kzalloc(sizeof(struct rpc_rqst), GFP_KERNEL); 1106 1106 if (!req) 1107 - break; 1107 + goto out_free; 1108 1108 list_add(&req->rq_list, &xprt->free); 1109 1109 } 1110 - if (i < num_prealloc) 1111 - goto out_free; 1112 1110 if (max_alloc > num_prealloc) 1113 1111 xprt->max_reqs = max_alloc; 1114 1112 else