ALSA: usb-audio: Fix a limit check in proc_dump_substream_formats()
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- sound/usb/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/proc.c +1 -1
@@ -140,7 +140,7 @@ static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct ssnd_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
Signature · 1 line
2.26.1
Takashi Iwai
AppliedQuoted 6 lines · Dan Carpenter
This should be
ARRAY_SIZE()instead ofsizeof(). Thesizeof()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 <[email protected]>
Thanks, applied.
Takashi