diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2015-02-21 23:55:00 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-02-23 09:11:24 +0100 |
commit | dec84316dd53c90e93b4ee849483bd4bd1e9a585 (patch) | |
tree | 3725938633e83ba9bf303e171323bbb911a0ba9f /sound/firewire/fireworks/fireworks.c | |
parent | d23c2cc4485d10f0cedfef99dd2961d9652b1b3f (diff) | |
download | linux-stable-dec84316dd53c90e93b4ee849483bd4bd1e9a585.tar.gz linux-stable-dec84316dd53c90e93b4ee849483bd4bd1e9a585.tar.bz2 linux-stable-dec84316dd53c90e93b4ee849483bd4bd1e9a585.zip |
ALSA: fireworks/bebob/dice/oxfw: make it possible to shutdown safely
A part of these drivers, especially BeBoB driver, are programmed to wait
some events. Thus the drivers should not destroy any data in .remove()
context.
This commit moves some destructors from 'struct fw_driver.remove()' to
'struct snd_card.private_free()' to shutdown safely.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: <stable@vger.kernel.org> # 3.19+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/fireworks/fireworks.c')
-rw-r--r-- | sound/firewire/fireworks/fireworks.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/firewire/fireworks/fireworks.c b/sound/firewire/fireworks/fireworks.c index 1e33394d8a93..2682e7e3e5c9 100644 --- a/sound/firewire/fireworks/fireworks.c +++ b/sound/firewire/fireworks/fireworks.c @@ -184,8 +184,12 @@ efw_card_free(struct snd_card *card) { struct snd_efw *efw = card->private_data; + snd_efw_stream_destroy_duplex(efw); + snd_efw_transaction_remove_instance(efw); fw_unit_put(efw->unit); + kfree(efw->resp_buf); + if (efw->card_index >= 0) { mutex_lock(&devices_mutex); clear_bit(efw->card_index, devices_used); @@ -193,7 +197,6 @@ efw_card_free(struct snd_card *card) } mutex_destroy(&efw->mutex); - kfree(efw->resp_buf); } static int @@ -297,11 +300,6 @@ static void efw_remove(struct fw_unit *unit) { struct snd_efw *efw = dev_get_drvdata(&unit->device); - snd_efw_stream_destroy_duplex(efw); - snd_efw_transaction_remove_instance(efw); - - snd_card_disconnect(efw->card); - /* No need to wait for releasing card object in this context. */ snd_card_free_when_closed(efw->card); } |