diff options
author | Oliver Neukum <oneukum@suse.de> | 2007-08-31 12:15:27 +0200 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2007-10-16 15:59:36 +0200 |
commit | 5149fe2c15e2dfe349bfde27e1fea5593b40671f (patch) | |
tree | 646b2a4653d83d02545ca6a30a7a1e6339291a5e /sound/usb | |
parent | 15944806e247076c0886aabe160bee391ce0629c (diff) | |
download | kernel_goldelico_gta04-5149fe2c15e2dfe349bfde27e1fea5593b40671f.zip kernel_goldelico_gta04-5149fe2c15e2dfe349bfde27e1fea5593b40671f.tar.gz kernel_goldelico_gta04-5149fe2c15e2dfe349bfde27e1fea5593b40671f.tar.bz2 |
[ALSA] missing error check in usb sound driver
usb_set_interface() can fail, even for altsetting 0
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/usbaudio.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index e1558a6..967b823 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c @@ -1308,7 +1308,11 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt) /* close the old interface */ if (subs->interface >= 0 && subs->interface != fmt->iface) { - usb_set_interface(subs->dev, subs->interface, 0); + if (usb_set_interface(subs->dev, subs->interface, 0) < 0) { + snd_printk(KERN_ERR "%d:%d:%d: return to setting 0 failed\n", + dev->devnum, fmt->iface, fmt->altsetting); + return -EIO; + } subs->interface = -1; subs->format = 0; } |