From: Takashi Iwai Date: Sat, 1 Feb 2020 08:05:30 +0000 (+0100) Subject: ALSA: dummy: Fix PCM format loop in proc output X-Git-Tag: Ubuntu-5.4.0-17.21~900 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=6fe6832df9d326cd34bf7b47233f5b183a039727;p=mirror_ubuntu-focal-kernel.git ALSA: dummy: Fix PCM format loop in proc output 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: Link: https://lore.kernel.org/r/20200201080530.22390-3-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman Signed-off-by: Paolo Pisati --- diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index aee7c04d49e5..b61ba0321a72 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -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)); }