]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.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)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 17 Feb 2020 09:57:39 +0000 (10:57 +0100)
BugLink: https://bugs.launchpad.net/bugs/1863588
commit 2acf25f13ebe8beb40e97a1bbe76f36277c64f1e upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
sound/drivers/dummy.c

index aee7c04d49e524679d694e37709b680e2cb03e11..b61ba0321a728e8c83d52951571b207f248b11c1 100644 (file)
@@ -915,7 +915,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));
        }