summaryrefslogtreecommitdiff
path: root/sound/usb/proc.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-04-22 12:22:55 +0300
committerTakashi Iwai <tiwai@suse.de>2020-04-22 11:29:15 +0200
commit8137d2763bf77d68babb38a7323c5152c945f20e (patch)
tree7f5ee20f8f4adcf394143fdd77dd00a3bbe46f2b /sound/usb/proc.c
parent093b8494f2992e58c2bef6fc26c7e11464ad415a (diff)
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: 093b8494f299 ("ALSA: usb-audio: Print more information in stream proc files") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20200422092255.GB195357@mwanda Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/proc.c')
-rw-r--r--sound/usb/proc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/usb/proc.c b/sound/usb/proc.c
index 5a36e192ebb0..889c550c9f29 100644
--- a/sound/usb/proc.c
+++ b/sound/usb/proc.c
@@ -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