summaryrefslogtreecommitdiff
path: root/sound/usb
diff options
context:
space:
mode:
authorArd van Breemen <ard@kwaak.net>2019-08-02 14:52:14 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-05 16:11:34 +0300
commit2c065494301f102e120ec863c9b9566c25d06956 (patch)
treef655c7bd7990ba9522f1efe7136d8d3b10c694c5 /sound/usb
parentd284cf4c49c2d82f0b8eb83a96aa26aa46764e18 (diff)
downloadlinux-2c065494301f102e120ec863c9b9566c25d06956.tar.xz
ALSA: usb-audio: Skip bSynchAddress endpoint check if it is invalid
[ Upstream commit 1b34121d9f26d272b0b2334209af6b6fc82d4bf1 ] The Linux kernel assumes that get_endpoint(alts,0) and get_endpoint(alts,1) are eachothers feedback endpoints. To reassure that validity it will test bsynchaddress to comply with that assumption. But if the bsyncaddress is 0 (invalid), it will flag that as a wrong assumption and return an error. Fix: Skip the test if bSynchAddress is 0. Note: those with a valid bSynchAddress should have a code quirck added. Signed-off-by: Ard van Breemen <ard@kwaak.net> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/pcm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index e4bbf79de956..33cd26763c0e 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -457,6 +457,7 @@ static int set_sync_endpoint(struct snd_usb_substream *subs,
}
ep = get_endpoint(alts, 1)->bEndpointAddress;
if (get_endpoint(alts, 0)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE &&
+ get_endpoint(alts, 0)->bSynchAddress != 0 &&
((is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress | USB_DIR_IN)) ||
(!is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress & ~USB_DIR_IN)))) {
dev_err(&dev->dev,