stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: dice: fix null pointer dereference when node is disconnected
@ 2021-03-12  9:34 Takashi Sakamoto
  2021-03-12 13:13 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Takashi Sakamoto @ 2021-03-12  9:34 UTC (permalink / raw)
  To: tiwai, perex; +Cc: clemens, alsa-devel, ffado-devel, stable

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: <stable@vger.kernel.org> # v5.4 or later
Fixes: e9f21129b8d8 ("ALSA: dice: support AMDTP domain")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/firewire/dice/dice-stream.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/firewire/dice/dice-stream.c b/sound/firewire/dice/dice-stream.c
index 8e0c0380b4c4..1a14c083e8ce 100644
--- a/sound/firewire/dice/dice-stream.c
+++ b/sound/firewire/dice/dice-stream.c
@@ -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);
 	}
 }
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: dice: fix null pointer dereference when node is disconnected
  2021-03-12  9:34 [PATCH] ALSA: dice: fix null pointer dereference when node is disconnected Takashi Sakamoto
@ 2021-03-12 13:13 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2021-03-12 13:13 UTC (permalink / raw)
  To: Takashi Sakamoto; +Cc: perex, clemens, alsa-devel, ffado-devel, stable

On Fri, 12 Mar 2021 10:34:07 +0100,
Takashi Sakamoto wrote:
> 
> 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: <stable@vger.kernel.org> # v5.4 or later
> Fixes: e9f21129b8d8 ("ALSA: dice: support AMDTP domain")
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

Applied, thanks.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-12 13:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12  9:34 [PATCH] ALSA: dice: fix null pointer dereference when node is disconnected Takashi Sakamoto
2021-03-12 13:13 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).