All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/10] use safer test on the result of find_first_zero_bit
@ 2014-06-04  9:07 ` Julia Lawall
  0 siblings, 0 replies; 98+ messages in thread
From: Julia Lawall @ 2014-06-04  9:07 UTC (permalink / raw)
  To: linux-rdma
  Cc: devel, linux-s390, linux-fbdev, linux-scsi, iss_storagedev,
	linux-sh, kernel-janitors, linux-wireless, linux-kernel, ath10k,
	adi-buildroot-devel, netdev

Find_first_zero_bit considers BITS_PER_LONG bits at a time, and thus may
return a larger number than the maximum position argument if that position
is not a multiple of BITS_PER_LONG.


^ permalink raw reply	[flat|nested] 98+ messages in thread
* Re: [PATCH 7/10] cciss: use safer test on the result of find_first_zero_bit
@ 2014-06-04 14:51 scameron
  2014-06-04 15:10 ` Julia Lawall
  2014-06-04 16:55 ` Jens Axboe
  0 siblings, 2 replies; 98+ messages in thread
From: scameron @ 2014-06-04 14:51 UTC (permalink / raw)
  To: Julia Lawall; +Cc: linux-kernel, axboe

> Find_first_zero_bit considers BITS_PER_LONG bits at a time, and thus may
> return a larger number than the maximum position argument if that position
> is not a multiple of BITS_PER_LONG.
> 
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression e1,e2,e3;
> statement S1,S2;
> @@
> 
> e1 = find_first_zero_bit(e2,e3)
> ...
> if (e1 
> - ==
> + >=
>   e3)
> S1 else S2
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/block/cciss.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/block/cciss.c b/drivers/block/cciss.c
> --- a/drivers/block/cciss.c
> +++ b/drivers/block/cciss.c
> @@ -980,7 +980,7 @@ static CommandList_struct *cmd_alloc(ctl
>  
>  	do {
>  		i = find_first_zero_bit(h->cmd_pool_bits, h->nr_cmds);
> -		if (i == h->nr_cmds)
> +		if (i >= h->nr_cmds)
>  			return NULL;
>  	} while (test_and_set_bit(i, h->cmd_pool_bits) != 0);
>  	c = h->cmd_pool + i;


Thanks. Ack.

You can add

Reviewed-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>

to this patch if you want.

You might consider adding "Cc: stable@vger.kernel.org" into the
sign-off area as well.

-- steve


^ permalink raw reply	[flat|nested] 98+ messages in thread

end of thread, other threads:[~2014-06-24  7:56 UTC | newest]

Thread overview: 98+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-04  9:07 [PATCH 0/10] use safer test on the result of find_first_zero_bit Julia Lawall
2014-06-04  9:07 ` Julia Lawall
2014-06-04  9:07 ` Julia Lawall
2014-06-04  9:07 ` Julia Lawall
2014-06-04  9:07 ` [PATCH 1/10] sh: " Julia Lawall
2014-06-04  9:07   ` Julia Lawall
2014-06-04  9:07 ` [PATCH 2/10] ath10k: " Julia Lawall
2014-06-04  9:07   ` Julia Lawall
2014-06-04  9:07   ` Julia Lawall
2014-06-04  9:07 ` [PATCH 3/10] video: " Julia Lawall
2014-06-04  9:07   ` Julia Lawall
2014-06-23 11:50   ` Tomi Valkeinen
2014-06-23 11:50     ` Tomi Valkeinen
2014-06-23 14:12     ` Julia Lawall
2014-06-23 14:12       ` Julia Lawall
2014-06-24  7:56       ` Tomi Valkeinen
2014-06-24  7:56         ` Tomi Valkeinen
2014-06-04  9:07 ` [PATCH 4/10] staging: tidspbridge: " Julia Lawall
2014-06-04  9:07   ` Julia Lawall
2014-06-04  9:07 ` [PATCH 5/10] ARC: " Julia Lawall
2014-06-04  9:07   ` Julia Lawall
2014-06-04  9:07 ` [PATCH 6/10] hpsa: " Julia Lawall
2014-06-04  9:07   ` Julia Lawall
2014-06-04 14:54   ` scameron
2014-06-04 14:54     ` scameron
2014-06-04 15:06     ` Julia Lawall
2014-06-04 15:06       ` Julia Lawall
2014-06-04 15:14       ` scameron
2014-06-04 15:14         ` scameron
2014-06-04  9:07 ` [PATCH 7/10] cciss: " Julia Lawall
2014-06-04  9:07   ` Julia Lawall
2014-06-04  9:07 ` [PATCH 8/10] s390/pci: " Julia Lawall
2014-06-04  9:07   ` Julia Lawall
2014-06-04 11:09   ` Sebastian Ott
2014-06-04 11:09     ` Sebastian Ott
2014-06-04  9:07 ` [PATCH 9/10] IB/qib: " Julia Lawall
2014-06-04  9:07   ` Julia Lawall
2014-06-04 18:41   ` Marciniszyn, Mike
2014-06-04 18:41     ` Marciniszyn, Mike
     [not found]     ` <32E1700B9017364D9B60AED9960492BC21BE92E6-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-04 19:19       ` Julia Lawall
2014-06-04 19:19         ` Julia Lawall
2014-06-04 19:19         ` Julia Lawall
     [not found]         ` <alpine.DEB.2.02.1406042118420.1977-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
2014-06-04 20:03           ` Marciniszyn, Mike
2014-06-04 20:03             ` Marciniszyn, Mike
2014-06-04 20:03             ` Marciniszyn, Mike
2014-06-04  9:08 ` [PATCH 10/10] blackfin: " Julia Lawall
2014-06-04  9:08   ` Julia Lawall
2014-06-04  9:35 ` [PATCH 0/10] " Geert Uytterhoeven
2014-06-04  9:35   ` Geert Uytterhoeven
2014-06-04  9:35   ` Geert Uytterhoeven
2014-06-04  9:35   ` Geert Uytterhoeven
     [not found]   ` <CAMuHMdXsoFUXj4jLMWN6NY7Um19KwWO9Rhx=9=gqWu_K5Ev2kQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-04  9:38     ` Julia Lawall
2014-06-04  9:38       ` Julia Lawall
2014-06-04  9:38       ` Julia Lawall
2014-06-04  9:38       ` Julia Lawall
2014-06-04  9:38       ` Julia Lawall
2014-06-04  9:46       ` David Laight
2014-06-04  9:46         ` David Laight
2014-06-04  9:46         ` David Laight
2014-06-04  9:46         ` David Laight
2014-06-04  9:46         ` David Laight
2014-06-04  9:46         ` David Laight
2014-06-04  9:52         ` Julia Lawall
2014-06-04  9:52           ` Julia Lawall
2014-06-04  9:52           ` Julia Lawall
2014-06-04  9:52           ` Julia Lawall
2014-06-04  9:52           ` Julia Lawall
2014-06-04 10:55           ` Geert Uytterhoeven
2014-06-04 10:55             ` Geert Uytterhoeven
2014-06-04 10:55             ` Geert Uytterhoeven
2014-06-04 10:55             ` Geert Uytterhoeven
2014-06-04 10:55             ` Geert Uytterhoeven
2014-06-04 11:00             ` Julia Lawall
2014-06-04 11:00               ` Julia Lawall
2014-06-04 11:00               ` Julia Lawall
2014-06-04 11:00               ` Julia Lawall
2014-06-04 11:00               ` Julia Lawall
2014-06-04 11:07               ` Geert Uytterhoeven
2014-06-04 11:07                 ` Geert Uytterhoeven
2014-06-04 11:07                 ` Geert Uytterhoeven
2014-06-04 11:07                 ` Geert Uytterhoeven
2014-06-04 11:07                 ` Geert Uytterhoeven
2014-06-04 11:07                 ` Geert Uytterhoeven
2014-06-04 13:12                 ` Julia Lawall
2014-06-04 13:12                   ` Julia Lawall
2014-06-04 13:12                   ` Julia Lawall
2014-06-04 13:12                   ` Julia Lawall
2014-06-04 13:12                   ` Julia Lawall
2014-06-04 13:34                   ` David Laight
2014-06-04 13:34                     ` David Laight
2014-06-04 13:34                     ` David Laight
2014-06-04 13:34                     ` David Laight
2014-06-04 13:34                     ` David Laight
2014-06-04 14:51 [PATCH 7/10] cciss: " scameron
2014-06-04 15:10 ` Julia Lawall
2014-06-04 16:55 ` Jens Axboe
2014-06-04 16:59   ` Julia Lawall
2014-06-04 17:02     ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.