lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <526912C1.6070502@huawei.com>
Date:	Thu, 24 Oct 2013 20:29:53 +0800
From:	Ding Tianhong <dingtianhong@...wei.com>
To:	wangweidong <wangweidong1@...wei.com>
CC:	<davem@...emloft.net>, <Trond.Myklebust@...app.com>,
	<bfields@...ldses.org>, <netdev@...r.kernel.org>,
	<linux-nfs@...r.kernel.org>
Subject: Re: [PACTH net-next] SUNRPC: remove an unnecessary if statement

On 2013/10/24 10:35, wangweidong wrote:
> 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@...wei.com>
> ---
>  net/sunrpc/xprt.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
> index 095363e..a8e20de 100644
> --- a/net/sunrpc/xprt.c
> +++ b/net/sunrpc/xprt.c
> @@ -1087,11 +1087,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
> -- 1.7.12
> 
> 

Acked-by: Ding Tianhong <dingtianhong@...wei.com>

> 
> 
> .
> 


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ