aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2010-06-11 11:34:19 -0400
committerTakashi Iwai <tiwai@suse.de>2010-06-11 12:05:05 -0400
commitd07140ba7fe1b41713627c6dc3f169a00019fb0e (patch)
tree247ef449b2476cee0d51481037878d8e84a2b517 /sound/usb
parentff8bd64eaf2963752feaa0ac2f7ff1254e0091ce (diff)
ALSA: usb-audio: add check for faulty clock in parse_audio_format_rates_v2()
Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/format.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/usb/format.c b/sound/usb/format.c
index 5367cd1e52d9..df5b29fed000 100644
--- a/sound/usb/format.c
+++ b/sound/usb/format.c
@@ -218,6 +218,12 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip,
218 int i, nr_rates, data_size, ret = 0; 218 int i, nr_rates, data_size, ret = 0;
219 int clock = snd_usb_clock_find_source(chip, chip->ctrl_intf, fp->clock); 219 int clock = snd_usb_clock_find_source(chip, chip->ctrl_intf, fp->clock);
220 220
221 if (clock < 0) {
222 snd_printk(KERN_ERR "%s(): unable to find clock source (clock %d)\n",
223 __func__, clock);
224 goto err;
225 }
226
221 /* get the number of sample rates first by only fetching 2 bytes */ 227 /* get the number of sample rates first by only fetching 2 bytes */
222 ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_RANGE, 228 ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_RANGE,
223 USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, 229 USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN,