]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ALSA: dummy: Fix PCM format loop in proc output
authorTakashi Iwai <tiwai@suse.de>
Sat, 1 Feb 2020 08:05:30 +0000 (09:05 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sat, 1 Feb 2020 08:06:33 +0000 (09:06 +0100)
The loop termination for iterating over all formats should contain
SNDRV_PCM_FORMAT_LAST, not less than it.

Fixes: 9b151fec139d ("ALSA: dummy - Add debug proc file")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200201080530.22390-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/drivers/dummy.c

index da0bd8960b3c88bcd817ec8fc81fbbcdefbd0eb4..02ac3f4e0c02f63d76b61ee3a9a28d139d8ea62d 100644 (file)
@@ -903,7 +903,7 @@ static void print_formats(struct snd_dummy *dummy,
 {
        int i;
 
-       for (i = 0; i < SNDRV_PCM_FORMAT_LAST; i++) {
+       for (i = 0; i <= SNDRV_PCM_FORMAT_LAST; i++) {
                if (dummy->pcm_hw.formats & (1ULL << i))
                        snd_iprintf(buffer, " %s", snd_pcm_format_name(i));
        }