]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ALSA: usb-audio: Fix control 'access overflow' errors from chmap
authorTakashi Iwai <tiwai@suse.de>
Fri, 11 Dec 2020 13:00:48 +0000 (14:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:25:42 +0000 (11:25 +0100)
commit1b4ea92e45841e41b20cb96d55a645e7fbb5b82c
treede0a8b346db341e43fa7eab696794d312cb407f7
parente60956a2d672adcf4e9f96c8e6c2c3fb113c8898
ALSA: usb-audio: Fix control 'access overflow' errors from chmap

commit c6dde8ffd071aea9d1ce64279178e470977b235c upstream.

The current channel-map control implementation in USB-audio driver may
lead to an error message like
  "control 3:0:0:Playback Channel Map:0: access overflow"
when CONFIG_SND_CTL_VALIDATION is set.  It's because the chmap get
callback clears the whole array no matter which count is set, and
rather the false-positive detection.

This patch fixes the problem by clearing only the needed array range
at usb_chmap_ctl_get().

Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201211130048.6358-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/stream.c