Skip to content

Commit

Permalink
[ALSA] usbaudio - Fix kobject_add() error at reconnection
Browse files Browse the repository at this point in the history
Fixed the error from kobject_add() at reconnection the usb audio device.
This happens when an app keeps opening a device while the device is
replugged, due to the confliction of the internal bookkept index and
the really empty slot.

Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
  • Loading branch information
tiwai authored and Jaroslav Kysela committed Jan 9, 2007
1 parent 7fbe3ca commit 2a2a5dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/usb/usbaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -3286,6 +3286,7 @@ 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;
}
Expand Down Expand Up @@ -3547,7 +3548,6 @@ 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 {
Expand Down

0 comments on commit 2a2a5dd

Please sign in to comment.