Commit 8137d276 authored by Dan Carpenter's avatar Dan Carpenter Committed by Takashi Iwai

ALSA: usb-audio: Fix a limit check in proc_dump_substream_formats()

This should be ARRAY_SIZE() instead of sizeof().  The sizeof() limit is
too high so it doesn't work.

Fixes: 093b8494 ("ALSA: usb-audio: Print more information in stream proc files")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200422092255.GB195357@mwandaSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 093b8494
......@@ -140,7 +140,7 @@ static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct s
snd_iprintf(buffer, " Channel map:");
for (c = 0; c < map->channels; c++) {
if (map->map[c] >= sizeof(channel_labels) ||
if (map->map[c] >= ARRAY_SIZE(channel_labels) ||
!channel_labels[map->map[c]])
snd_iprintf(buffer, " --");
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment