public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] sound/pci/cs46xx/: fix an off-by-one
@ 2007-07-23 14:51 Adrian Bunk
  2007-07-24 12:32 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Bunk @ 2007-07-23 14:51 UTC (permalink / raw)
  To: perex; +Cc: linux-kernel

This patch fixes an off-by-one in a snd_assert() spotted by the 
Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---
--- linux-2.6.22-rc6-mm1/sound/pci/cs46xx/dsp_spos_scb_lib.c.old	2007-07-23 15:33:17.000000000 +0200
+++ linux-2.6.22-rc6-mm1/sound/pci/cs46xx/dsp_spos_scb_lib.c	2007-07-23 15:33:37.000000000 +0200
@@ -1480,7 +1480,7 @@ void cs46xx_dsp_destroy_pcm_channel (str
 	if (!pcm_channel->src_scb->ref_count) {
 		cs46xx_dsp_remove_scb(chip,pcm_channel->src_scb);
 
-		snd_assert (pcm_channel->src_slot >= 0 && pcm_channel->src_slot <= DSP_MAX_SRC_NR,
+		snd_assert (pcm_channel->src_slot >= 0 && pcm_channel->src_slot < DSP_MAX_SRC_NR,
 			    return );
 
 		ins->src_scb_slots[pcm_channel->src_slot] = 0;


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

* Re: [2.6 patch] sound/pci/cs46xx/: fix an off-by-one
  2007-07-23 14:51 [2.6 patch] sound/pci/cs46xx/: fix an off-by-one Adrian Bunk
@ 2007-07-24 12:32 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2007-07-24 12:32 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: perex, linux-kernel

At Mon, 23 Jul 2007 16:51:16 +0200,
Adrian Bunk wrote:
> 
> This patch fixes an off-by-one in a snd_assert() spotted by the 
> Coverity checker.
> 
> Signed-off-by: Adrian Bunk <bunk@stusta.de>

Applied it to ALSA tree.  Thanks.


Takashi

> 
> ---
> --- linux-2.6.22-rc6-mm1/sound/pci/cs46xx/dsp_spos_scb_lib.c.old	2007-07-23 15:33:17.000000000 +0200
> +++ linux-2.6.22-rc6-mm1/sound/pci/cs46xx/dsp_spos_scb_lib.c	2007-07-23 15:33:37.000000000 +0200
> @@ -1480,7 +1480,7 @@ void cs46xx_dsp_destroy_pcm_channel (str
>  	if (!pcm_channel->src_scb->ref_count) {
>  		cs46xx_dsp_remove_scb(chip,pcm_channel->src_scb);
>  
> -		snd_assert (pcm_channel->src_slot >= 0 && pcm_channel->src_slot <= DSP_MAX_SRC_NR,
> +		snd_assert (pcm_channel->src_slot >= 0 && pcm_channel->src_slot < DSP_MAX_SRC_NR,
>  			    return );
>  
>  		ins->src_scb_slots[pcm_channel->src_slot] = 0;
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

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

end of thread, other threads:[~2007-07-24 12:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-23 14:51 [2.6 patch] sound/pci/cs46xx/: fix an off-by-one Adrian Bunk
2007-07-24 12:32 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox