Re: [PATCH] ALSA: test off by one in setsamplerate()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Sun, 27 Dec 2009 22:26:47 +0100,
Roel Kluin wrote:
> 
> With `while (i++ < MAX_WRITE_RETRY)' i reaches MAX_WRITE_RETRY + 1 after the loop
> 
> Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>

Applied now.  Thanks.


Takashi

> ---
>  sound/pci/riptide/riptide.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
> index b5ca02e..e66ef2b 100644
> --- a/sound/pci/riptide/riptide.c
> +++ b/sound/pci/riptide/riptide.c
> @@ -1058,7 +1058,7 @@ setsamplerate(struct cmdif *cif, unsigned char *intdec, unsigned int rate)
>  				 rptr.retwords[2] != M &&
>  				 rptr.retwords[3] != N &&
>  				 i++ < MAX_WRITE_RETRY);
> -			if (i == MAX_WRITE_RETRY) {
> +			if (i > MAX_WRITE_RETRY) {
>  				snd_printdd("sent samplerate %d: %d failed\n",
>  					    *intdec, rate);
>  				return -EIO;
> 
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux