summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2015-01-04 19:59:29 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-16 06:59:51 -0800
commit046a9bfa6203b6a08af7e77e4a1d691baca01367 (patch)
tree8488d158b7b1d40ba9a99a09b4027fb4a782a7ec /sound
parent9e31ed5fc640096f73626ec13d6793efae2a5ec5 (diff)
ALSA: snd-usb-caiaq: fix stream count check
commit 49cdd5b641933fda6324fc901eaf856924ba6a27 upstream. Commit 897c329bc ("ALSA: usb: caiaq: check for cdev->n_streams > 1") introduced a safety check to protect against bogus data provided by devices. However, the n_streams variable is already divided by CHANNELS_PER_STREAM, so the correct check is 'n_streams > 0'. Fix this to un-break support for stereo devices. Signed-off-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/caiaq/audio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
index 272844746135..327f8642ca80 100644
--- a/sound/usb/caiaq/audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -816,7 +816,7 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *cdev)
return -EINVAL;
}
- if (cdev->n_streams < 2) {
+ if (cdev->n_streams < 1) {
dev_err(dev, "bogus number of streams: %d\n", cdev->n_streams);
return -EINVAL;
}