All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: oxfw: fix NULL pointer dereference to unused stream structure
@ 2019-08-26 13:54 Takashi Sakamoto
  2019-08-26 14:01 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Takashi Sakamoto @ 2019-08-26 13:54 UTC (permalink / raw
  To: clemens, tiwai; +Cc: alsa-devel

ALSA oxfw driver supports Griffin FireWave. This device supports one
isochronous stream for PCM playback. Current driver executes code to
wait event for stream structure of opposite direction. This causes
NULL pointer dereference.

This commit fixes the bug.

Fixes: ac5d77864cfc ("ALSA: oxfw: support AMDTP domain")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/firewire/oxfw/oxfw-stream.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sound/firewire/oxfw/oxfw-stream.c b/sound/firewire/oxfw/oxfw-stream.c
index 0318dc4dcc55..3c9a796b6526 100644
--- a/sound/firewire/oxfw/oxfw-stream.c
+++ b/sound/firewire/oxfw/oxfw-stream.c
@@ -350,13 +350,18 @@ int snd_oxfw_stream_start_duplex(struct snd_oxfw *oxfw)
 
 		// Wait first packet.
 		if (!amdtp_stream_wait_callback(&oxfw->rx_stream,
-						CALLBACK_TIMEOUT) ||
-		    !amdtp_stream_wait_callback(&oxfw->tx_stream,
 						CALLBACK_TIMEOUT)) {
 			err = -ETIMEDOUT;
 			goto error;
 		}
 
+		if (oxfw->has_output) {
+			if (!amdtp_stream_wait_callback(&oxfw->tx_stream,
+							CALLBACK_TIMEOUT)) {
+				err = -ETIMEDOUT;
+				goto error;
+			}
+		}
 	}
 
 	return 0;
-- 
2.20.1

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

* Re: [PATCH] ALSA: oxfw: fix NULL pointer dereference to unused stream structure
  2019-08-26 13:54 [PATCH] ALSA: oxfw: fix NULL pointer dereference to unused stream structure Takashi Sakamoto
@ 2019-08-26 14:01 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2019-08-26 14:01 UTC (permalink / raw
  To: Takashi Sakamoto; +Cc: alsa-devel, clemens

On Mon, 26 Aug 2019 15:54:15 +0200,
Takashi Sakamoto wrote:
> 
> ALSA oxfw driver supports Griffin FireWave. This device supports one
> isochronous stream for PCM playback. Current driver executes code to
> wait event for stream structure of opposite direction. This causes
> NULL pointer dereference.
> 
> This commit fixes the bug.
> 
> Fixes: ac5d77864cfc ("ALSA: oxfw: support AMDTP domain")
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

Thanks, applied.


Takashi

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

end of thread, other threads:[~2019-08-26 14:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-26 13:54 [PATCH] ALSA: oxfw: fix NULL pointer dereference to unused stream structure Takashi Sakamoto
2019-08-26 14:01 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.