[PATCH 3.18 080/150] ALSA: snd-usb-caiaq: fix stream count check

From: Greg Kroah-Hartman
Date: Wed Jan 14 2015 - 03:27:43 EST


3.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Daniel Mack <daniel@xxxxxxxxxx>

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@xxxxxxxxxx>
Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
sound/usb/caiaq/audio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/usb/caiaq/audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -816,7 +816,7 @@ int snd_usb_caiaq_audio_init(struct snd_
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;
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/