Skip to content

Commit

Permalink
ALSA: dummy: Fix PCM format loop in proc output
Browse files Browse the repository at this point in the history
commit 2acf25f upstream.

The loop termination for iterating over all formats should contain
SNDRV_PCM_FORMAT_LAST, not less than it.

Fixes: 9b151fe ("ALSA: dummy - Add debug proc file")
Cc: <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
tiwai authored and gregkh committed Feb 11, 2020
1 parent a46ebc2 commit 23efa4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/drivers/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,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));
}
Expand Down

0 comments on commit 23efa4f

Please sign in to comment.