From: Takashi Iwai Subject: Re: [PATCH] ALSA: oxfw: fix a condition and return code in start_stream() Date: Fri, 27 Feb 2015 14:43:14 +0100 Message-ID: References: <20150226203202.GC6820@mwanda> <1424997572-2493-1-git-send-email-o-takashi@sakamocchi.jp> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 6A0F02650B0 for ; Fri, 27 Feb 2015 14:43:20 +0100 (CET) In-Reply-To: <1424997572-2493-1-git-send-email-o-takashi@sakamocchi.jp> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Takashi Sakamoto Cc: alsa-devel@alsa-project.org, clemens@ladisch.de, dan.carpenter@oracle.com List-Id: alsa-devel@alsa-project.org At Fri, 27 Feb 2015 09:39:32 +0900, Takashi Sakamoto wrote: > > 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 > Signed-off-by: Takashi Sakamoto Applied, thanks. Takashi > --- > sound/firewire/oxfw/oxfw-stream.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/sound/firewire/oxfw/oxfw-stream.c b/sound/firewire/oxfw/oxfw-stream.c > index 29ccb36..e6757cd 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, > } > > /* 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; > } > -- > 2.1.0 >