]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.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)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 4 Jan 2021 15:23:38 +0000 (16:23 +0100)
commita89d6da55647b7aa01c8c6c56effdfa809a6824f
treea7f6c836c37fb725d54a7a9653451c57c1206781
parent5be4619ab537a275dc7afec46f2e45330cba1d02
ALSA: usb-audio: Fix control 'access overflow' errors from chmap

BugLink: https://bugs.launchpad.net/bugs/1910106
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>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
sound/usb/stream.c