ALSA: oxfw: fix NULL pointer dereference to unused stream structure
[linux-2.6-block.git] / sound / firewire / oxfw / oxfw-stream.c
index 0318dc4dcc55f976cf807a3ed957348d15c06834..3c9a796b65269594c88886568f09a70627a62e07 100644 (file)
@@ -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;