diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2015-02-26 19:39:32 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-02-27 08:42:18 -0500 |
commit | f2b14c0bc510c6a8f67a4f36049deefe5d99a537 (patch) | |
tree | 7aa874e40c69809f05d56e50eb8644ad2ae8e2fb /sound | |
parent | de5d0ad506cb10ab143e2ffb9def7607e3671f83 (diff) |
ALSA: oxfw: fix a condition and return code in start_stream()
The amdtp_stream_wait_callback() doesn't return minus value and
the return code is not for error code.
This commit fixes with a propper condition and an error code.
Fixes: f3699e2c7745 ('ALSA: oxfw: Change the way to start stream')
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: <stable@vger.kernel.org> # 3.19+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/firewire/oxfw/oxfw-stream.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/firewire/oxfw/oxfw-stream.c b/sound/firewire/oxfw/oxfw-stream.c index 29ccb3637164..e6757cd85724 100644 --- a/sound/firewire/oxfw/oxfw-stream.c +++ b/sound/firewire/oxfw/oxfw-stream.c | |||
@@ -171,9 +171,10 @@ static int start_stream(struct snd_oxfw *oxfw, struct amdtp_stream *stream, | |||
171 | } | 171 | } |
172 | 172 | ||
173 | /* Wait first packet */ | 173 | /* Wait first packet */ |
174 | err = amdtp_stream_wait_callback(stream, CALLBACK_TIMEOUT); | 174 | if (!amdtp_stream_wait_callback(stream, CALLBACK_TIMEOUT)) { |
175 | if (err < 0) | ||
176 | stop_stream(oxfw, stream); | 175 | stop_stream(oxfw, stream); |
176 | err = -ETIMEDOUT; | ||
177 | } | ||
177 | end: | 178 | end: |
178 | return err; | 179 | return err; |
179 | } | 180 | } |