Skip to content
Commit 32b85442 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: jack: Unregister input device at disconnection



The recent change in sysfs triggered a kernel WARNING at unloading a
sound driver like

  WARNING: CPU: 3 PID: 2247 at fs/sysfs/group.c:214 sysfs_remove_group+0xe8/0xf0()
  sysfs group ffffffff81ab7b20 not found for kobject 'event14'

for each jack instance.  It's because the unregistration of jack input
device is done in dev_free callback, which is called after
snd_card_disconnect().  Since device_unregister(card->card_dev) is
called in snd_card_disconnect(), the whole sysfs entries belonging to
card->card_dev have been already removed recursively.  Thus this
results in a warning as input_unregister_device() yet tries to
unregister the already removed sysfs entry.

For fixing this mess, we need to unregister the jack input device at
dev_disconnect callback so that it's called before unregistering the
card->card_dev.

Reviwed-by: default avatarMark Brown <broonie@linaro.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 6408eac2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment