summaryrefslogtreecommitdiff
path: root/sound/firewire/oxfw
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2019-08-26 16:54:15 +0300
committerTakashi Iwai <tiwai@suse.de>2019-08-26 16:56:01 +0300
commit4c098dab121a4164e9daa4d1ddbc59e93054e79e (patch)
treee45b1d4ebfc19cd527b802013f45bc6b320ea068 /sound/firewire/oxfw
parentb39e077fcb283dd96dd251a3abeba585402c61fe (diff)
downloadlinux-4c098dab121a4164e9daa4d1ddbc59e93054e79e.tar.xz
ALSA: oxfw: fix NULL pointer dereference to unused stream structure
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> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/oxfw')
-rw-r--r--sound/firewire/oxfw/oxfw-stream.c9
1 files 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;