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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d38a984e-e9e3-1dfe-fc39-4c2f7c7ad0a1@lightnvm.io>
Date:   Tue, 11 Apr 2017 16:35:29 +0200
From:   Matias Bjørling <mb@...htnvm.io>
To:     Javier González <jg@...htnvm.io>
Cc:     linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
        Javier González <javier@...xlabs.com>
Subject: Re: [PATCH 2/3] lightnvm: fix type checks on rrpc

On 04/11/2017 04:18 PM, Javier González wrote:
> sector_t is always unsigned, therefore avoid < 0 checks on it.
>
> Signed-off-by: Javier González <javier@...xlabs.com>
> ---
>  drivers/lightnvm/rrpc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
> index 5dba544..cf0e28a 100644
> --- a/drivers/lightnvm/rrpc.c
> +++ b/drivers/lightnvm/rrpc.c
> @@ -817,7 +817,7 @@ static int rrpc_read_ppalist_rq(struct rrpc *rrpc, struct bio *bio,
>
>  	for (i = 0; i < npages; i++) {
>  		/* We assume that mapping occurs at 4KB granularity */
> -		BUG_ON(!(laddr + i >= 0 && laddr + i < rrpc->nr_sects));
> +		BUG_ON(!(laddr + i < rrpc->nr_sects));
>  		gp = &rrpc->trans_map[laddr + i];
>
>  		if (gp->rblk) {
> @@ -846,7 +846,7 @@ static int rrpc_read_rq(struct rrpc *rrpc, struct bio *bio, struct nvm_rq *rqd,
>  	if (!is_gc && rrpc_lock_rq(rrpc, bio, rqd))
>  		return NVM_IO_REQUEUE;
>
> -	BUG_ON(!(laddr >= 0 && laddr < rrpc->nr_sects));
> +	BUG_ON(!(laddr < rrpc->nr_sects));
>  	gp = &rrpc->trans_map[laddr];
>
>  	if (gp->rblk) {
>
Thanks. Applied for 4.12.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ