mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 11:40:53 +07:00
ALSA: snd-usb-caiaq: fix stream count check
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>
Cc: stable@kernel.org [v3.18+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
62f64a880a
commit
49cdd5b641
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user