* [PATCH] ALSA: usb-audio: Fix a limit check in proc_dump_substream_formats()
@ 2020-04-22 9:22 Dan Carpenter
2020-04-22 9:29 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-04-22 9:22 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai; +Cc: alsa-devel, kernel-janitors, Allison Randal
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>
---
sound/usb/proc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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
--
2.26.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: usb-audio: Fix a limit check in proc_dump_substream_formats()
2020-04-22 9:22 [PATCH] ALSA: usb-audio: Fix a limit check in proc_dump_substream_formats() Dan Carpenter
@ 2020-04-22 9:29 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2020-04-22 9:29 UTC (permalink / raw)
To: Dan Carpenter; +Cc: alsa-devel, kernel-janitors, Takashi Iwai, Allison Randal
On Wed, 22 Apr 2020 11:22:55 +0200,
Dan Carpenter wrote:
>
> 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>
Thanks, applied.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-22 9:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-22 9:22 [PATCH] ALSA: usb-audio: Fix a limit check in proc_dump_substream_formats() Dan Carpenter
2020-04-22 9:29 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox