Skip to contentSkip to conversation

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

PATCH Applied Dan Carpenter 2 participants 2 messages Apr 22, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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")
---
 sound/usb/proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/proc.c +1 -1
index 5a36e192ebb0..889c550c9f29 100644
@@ -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
Signature · 1 line
2.26.1
Applied
#1 lore raw
Quoted 6 lines · Dan Carpenter

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")

Thanks, applied.

Takashi