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] [day] [month] [year] [list]
Message-Id: <CC07C792-D6D1-4D76-8384-14470E5B0075@gmail.com>
Date:	Wed, 17 Aug 2011 14:45:06 -0400
From:	Jean-Francois Dagenais <jeff.dagenais@...il.com>
To:	Dan Carpenter <error27@...il.com>
Cc:	bojan prtvar <prtvar.b@...il.com>,
	Evgeniy Polyakov <johnpol@....mipt.ru>,
	Andrew Morton <akpm@...ux-foundation.org>,
	open list <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org
Subject: Re: [patch v2] w1: fix for loop in w1_f29_remove_slave()

> The for loop was looking for i <= 0 instead of i >= 0 so this
> function never did anything.  Also we started with i =
> NB_SYSFS_BIN_FILES instead of "NB_SYSFS_BIN_FILES - 1" which is an
> off by one bug.
> 
> Reported-by: Bojan Prtvar <prtvar.b@...il.com>
> Signed-off-by: Dan Carpenter <error27@...il.com>
Acked-by: Jean-François Dagenais <dagenaisj@...atest.com>
> ---
> v2:  fix >= vs <=
> 
> diff --git a/drivers/w1/slaves/w1_ds2408.c b/drivers/w1/slaves/w1_ds2408.c
> index c377818..7c8cdb8 100644
> --- a/drivers/w1/slaves/w1_ds2408.c
> +++ b/drivers/w1/slaves/w1_ds2408.c
> @@ -373,7 +373,7 @@ static int w1_f29_add_slave(struct w1_slave *sl)
> static void w1_f29_remove_slave(struct w1_slave *sl)
> {
> 	int i;
> -	for (i = NB_SYSFS_BIN_FILES; i <= 0; --i)
> +	for (i = NB_SYSFS_BIN_FILES - 1; i >= 0; --i)
> 		sysfs_remove_bin_file(&sl->dev.kobj,
> 			&(w1_f29_sysfs_bin_files[i]));
> }

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ