Skip to content

Commit

Permalink
ALSA: dice: fix null pointer dereference when node is disconnected
Browse files Browse the repository at this point in the history
When node is removed from IEEE 1394 bus, any transaction fails to the node.
In the case, ALSA dice driver doesn't stop isochronous contexts even if
they are running. As a result, null pointer dereference occurs in callback
from the running context.

This commit fixes the bug to release isochronous contexts always.

Cc: <[email protected]> # v5.4 or later
Fixes: e9f2112 ("ALSA: dice: support AMDTP domain")
Signed-off-by: Takashi Sakamoto <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
takaswie authored and tiwai committed Mar 12, 2021
1 parent 2bf44e0 commit dd7b836
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sound/firewire/dice/dice-stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,10 @@ void snd_dice_stream_stop_duplex(struct snd_dice *dice)
struct reg_params tx_params, rx_params;

if (dice->substreams_counter == 0) {
if (get_register_params(dice, &tx_params, &rx_params) >= 0) {
amdtp_domain_stop(&dice->domain);
if (get_register_params(dice, &tx_params, &rx_params) >= 0)
finish_session(dice, &tx_params, &rx_params);
}

amdtp_domain_stop(&dice->domain);
release_resources(dice);
}
}
Expand Down

0 comments on commit dd7b836

Please sign in to comment.