]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit - sound/core/jack.c
ALSA: jack: Unregister input device at disconnection
authorTakashi Iwai <tiwai@suse.de>
Thu, 14 Nov 2013 14:35:46 +0000 (15:35 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 14 Nov 2013 16:22:45 +0000 (17:22 +0100)
commit32b8544296b944b204b33f9837701d4d0b9adefe
tree307ee25de70ac19e9fa93d2e231088c12ce583ef
parent6408eac2665955343cd0e4bcd7d6237ce39611ed
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: Mark Brown <broonie@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/jack.c