]> git.baikalelectronics.ru Git - 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)
committerTakashi Iwai <tiwai@suse.de>
Fri, 11 Dec 2020 13:03:55 +0000 (14:03 +0100)
commit0a29fb1580060b27aa4baf63dbdcf69e9bd120ee
treece7971407b6347f7f36b535ab97bd3796bc23154
parentc17bf8230a41c5757ec6a46b859e2cd9bec945f8
ALSA: usb-audio: Fix control 'access overflow' errors from chmap

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>
sound/usb/stream.c