mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 22:21:21 +00:00
[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>
This commit is contained in:
parent
15944806e2
commit
5149fe2c15
1 changed files with 5 additions and 1 deletions
|
@ -1308,7 +1308,11 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt)
|
||||||
|
|
||||||
/* close the old interface */
|
/* close the old interface */
|
||||||
if (subs->interface >= 0 && subs->interface != fmt->iface) {
|
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->interface = -1;
|
||||||
subs->format = 0;
|
subs->format = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue