From: wangweidong Date: Tue, 15 Oct 2013 03:44:30 +0000 (+0800) Subject: SUNRPC: remove an unnecessary if statement X-Git-Tag: v5.15~18830^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8313164c36473193c8034de643dc32f35a22bf59;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Trond Myklebust --- diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 49535505..04199bc 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, 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