Re: [patch]missing error check in usb sound driver
Takashi Iwai <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <s5hsl60f0a7.wl%[email protected]> |
At Fri, 31 Aug 2007 10:45:26 +0200, Oliver Neukum wrote: > > Hi, > > usb_set_interface() can fail, even for altsetting 0 > > Regards > Oliver > Signed-off-by: Oliver Neukum <[email protected]> I applied it to ALSA tree now. Thanks. Takashi > --- > > --- a/sound/usb/usbaudio.c 2007-08-31 10:21:36.000000000 +0200 > +++ b/sound/usb/usbaudio.c 2007-08-31 10:27:56.000000000 +0200 > @@ -1309,7 +1309,11 @@ static int set_format(struct snd_usb_sub > > /* 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; > } > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel