Commit 434e26d6 authored by Takashi Iwai's avatar Takashi Iwai Committed by Greg Kroah-Hartman

ALSA: hda - Cancel probe work instead of flush at remove

commit 0b8c8219 upstream.

The commit [991f86d7: ALSA: hda - Flush the pending probe work at
remove] introduced the sync of async probe work at remove for fixing
the race.  However, this may lead to another hangup when the module
removal is performed quickly before starting the probe work, because
it issues flush_work() and it's blocked forever.

The workaround is to use cancel_work_sync() instead of flush_work()
there.

Fixes: 991f86d7 ('ALSA: hda - Flush the pending probe work at remove')
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6deb0ec9
...@@ -2143,10 +2143,10 @@ static void azx_remove(struct pci_dev *pci) ...@@ -2143,10 +2143,10 @@ static void azx_remove(struct pci_dev *pci)
struct hda_intel *hda; struct hda_intel *hda;
if (card) { if (card) {
/* flush the pending probing work */ /* cancel the pending probing work */
chip = card->private_data; chip = card->private_data;
hda = container_of(chip, struct hda_intel, chip); hda = container_of(chip, struct hda_intel, chip);
flush_work(&hda->probe_work); cancel_work_sync(&hda->probe_work);
snd_card_free(card); snd_card_free(card);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment