mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-07 21:53:44 +00:00
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: f3699e2c77
('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>
This commit is contained in:
parent
de5d0ad506
commit
f2b14c0bc5
@ -171,9 +171,10 @@ static int start_stream(struct snd_oxfw *oxfw, struct amdtp_stream *stream,
|
||||
}
|
||||
|
||||
/* Wait first packet */
|
||||
err = amdtp_stream_wait_callback(stream, CALLBACK_TIMEOUT);
|
||||
if (err < 0)
|
||||
if (!amdtp_stream_wait_callback(stream, CALLBACK_TIMEOUT)) {
|
||||
stop_stream(oxfw, stream);
|
||||
err = -ETIMEDOUT;
|
||||
}
|
||||
end:
|
||||
return err;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user