Skip to contentSkip to conversation

sound/pci/cs46xx/: fix an off-by-one

PATCH Applied Adrian Bunk 2 participants 2 messages Jul 23, 2007 – Jul 24, 2007 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound/pci/cs46xx/: fix an off-by-one

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

---

sound/pci/cs46xx/dsp_spos_scb_lib.c renamed from sound/pci/cs46xx/dsp_spos_scb_lib.c.old +1 -1
@@ -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;
Applied
#1 lore raw

At Mon, 23 Jul 2007 16:51:16 +0200,

Quoted 5 lines · Adrian Bunk

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

Applied it to ALSA tree. Thanks.

Takashi

Quoted 20 lines

---

sound/pci/cs46xx/dsp_spos_scb_lib.c renamed from sound/pci/cs46xx/dsp_spos_scb_lib.c.old +1 -2
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/