diff options
author | Takashi Iwai <tiwai@suse.de> | 2024-08-08 11:15:21 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2024-08-08 11:16:15 +0200 |
commit | 9b88d0890ed9adab413ea991fac90842688e1017 (patch) | |
tree | 50b4cb24c2793bfbd4448a8f0f1afd4fc460557c /sound/usb/endpoint.c | |
parent | c01f3815453e2d5f699ccd8c8c1f93a5b8669e59 (diff) |
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.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/endpoint.c')
-rw-r--r-- | sound/usb/endpoint.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 8f65349a06d3..568099467dbb 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -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); |