diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2016-03-28 01:29:32 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-03-28 09:32:57 +0200 |
commit | 6b94fb14fcff3d9be13aae271f2345ab3f656b0c (patch) | |
tree | 462ab3de3b1e8b3f6a14f1c04b9632de4fb2bc90 | |
parent | ALSA: hda - Apply fix for white noise on Asus N550JV, too (diff) | |
download | linux-6b94fb14fcff3d9be13aae271f2345ab3f656b0c.tar.xz linux-6b94fb14fcff3d9be13aae271f2345ab3f656b0c.zip |
ALSA: dice: fix memory leak when unplugging
When sound card is going to be released, dice private data is
also released. Then all of data should be released. However,
stream data is not released. This causes memory leak when
unplugging dice unit.
This commit fixes the bug.
Fixes: 4bdc495c87b3('ALSA: dice: handle several PCM substreams when any isochronous streams are available')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/firewire/dice/dice-stream.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sound/firewire/dice/dice-stream.c b/sound/firewire/dice/dice-stream.c index 845d5e5884a4..ec4db3a514fc 100644 --- a/sound/firewire/dice/dice-stream.c +++ b/sound/firewire/dice/dice-stream.c @@ -446,18 +446,12 @@ end: void snd_dice_stream_destroy_duplex(struct snd_dice *dice) { - struct reg_params tx_params, rx_params; - - snd_dice_transaction_clear_enable(dice); + unsigned int i; - if (get_register_params(dice, &tx_params, &rx_params) == 0) { - stop_streams(dice, AMDTP_IN_STREAM, &tx_params); - stop_streams(dice, AMDTP_OUT_STREAM, &rx_params); + for (i = 0; i < MAX_STREAMS; i++) { + destroy_stream(dice, AMDTP_IN_STREAM, i); + destroy_stream(dice, AMDTP_OUT_STREAM, i); } - - release_resources(dice); - - dice->substreams_counter = 0; } void snd_dice_stream_update_duplex(struct snd_dice *dice) |