Skip to content

Commit 49cdd5b

Browse files
zonquetiwai
authored andcommitted
ALSA: snd-usb-caiaq: fix stream count check
Commit 897c329 ("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> Cc: stable@kernel.org [v3.18+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 62f64a8 commit 49cdd5b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎sound/usb/caiaq/audio.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *cdev)
816816
return -EINVAL;
817817
}
818818

819-
if (cdev->n_streams < 2) {
819+
if (cdev->n_streams < 1) {
820820
dev_err(dev, "bogus number of streams: %d\n", cdev->n_streams);
821821
return -EINVAL;
822822
}

0 commit comments

Comments
 (0)