From: Oliver Neukum Date: Fri, 31 Aug 2007 10:15:27 +0000 (+0200) Subject: [ALSA] missing error check in usb sound driver X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=5149fe2c15e2dfe349bfde27e1fea5593b40671f;p=deliverable%2Flinux.git [ALSA] missing error check in usb sound driver usb_set_interface() can fail, even for altsetting 0 Signed-off-by: Oliver Neukum Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index e1558a6c42d8..967b823eace0 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; }