[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-usb-devel
Subject:    Re: [linux-usb-devel] [patch]missing error check in usb sound driver
From:       Takashi Iwai <tiwai () suse ! de>
Date:       2007-08-31 10:47:44
Message-ID: s5hsl60f0a7.wl%tiwai () suse ! de
[Download RAW message or body]

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 <oneukum@suse.de>

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/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic