Commit 9b88d089 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: usb-audio: Check shutdown at endpoint_set_interface()

The call of usb_set_interface() and a delay are superfluous when the
device has been already disconnected.  Add a disconnection check
before doing it.

Link: https://patch.msgid.link/20240808091522.31415-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent c01f3815
......@@ -921,6 +921,9 @@ static int endpoint_set_interface(struct snd_usb_audio *chip,
if (ep->iface_ref->altset == altset)
return 0;
/* already disconnected? */
if (unlikely(atomic_read(&chip->shutdown)))
return -ENODEV;
usb_audio_dbg(chip, "Setting usb interface %d:%d for EP 0x%x\n",
ep->iface, altset, ep->ep_num);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment