]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: Fix NULL dereference by access to non-existing substream
authorTakashi Iwai <tiwai@suse.de>
Thu, 10 Jan 2013 13:06:38 +0000 (14:06 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 11 Jan 2013 10:12:17 +0000 (11:12 +0100)
commit4952a6e88b5d1c7289b2b07ab9f88c13971204d6
tree2f690edfbdb4d6511cd05d7332bb232895d9d842
parentf5c85e5c7ba88c2345ad6e1fa17eed406aba6ff5
ALSA: usb-audio: Fix NULL dereference by access to non-existing substream

The commit [d2de7fbf: ALSA: usb-audio: sync ep init fix for
audioformat mismatch] introduced the correction of parameters to be
set for sync EP.  But since the new code assumes that the sync EP is
always paired with the data EP of another direction, it triggers Oops
when a device only with a single direction is used.

This patch adds a proper check of sync EP type and the presence of the
paired substream for avoiding the crash.

Reported-and-tested-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/pcm.c