Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9eb70e68 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

[ALSA] usb-audio - Fix race in reconnection



Fix the race at reconnection of the device.
The disconnected usb_chip[] must be cleared before the next probe
call properly.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f18638dc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3424,7 +3424,6 @@ static void snd_usb_audio_create_proc(struct snd_usb_audio *chip)

static int snd_usb_audio_free(struct snd_usb_audio *chip)
{
	usb_chip[chip->index] = NULL;
	kfree(chip);
	return 0;
}
@@ -3689,6 +3688,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
		list_for_each(p, &chip->mixer_list) {
			snd_usb_mixer_disconnect(p);
		}
		usb_chip[chip->index] = NULL;
		mutex_unlock(&register_mutex);
		snd_card_free_when_closed(card);
	} else {