2016-04-06 11:37:31

by Dan Carpenter

[permalink] [raw]
Subject: [patch] ASoC: Intel: sst: fix a loop timeout in sst_hsw_stream_reset()

In the original code we ended the loop with tries set to -1 instead of
zero.

Signed-off-by: Dan Carpenter <[email protected]>
---
Not tested.

diff --git a/sound/soc/intel/haswell/sst-haswell-ipc.c b/sound/soc/intel/haswell/sst-haswell-ipc.c
index ac60f13..9156522 100644
--- a/sound/soc/intel/haswell/sst-haswell-ipc.c
+++ b/sound/soc/intel/haswell/sst-haswell-ipc.c
@@ -1345,7 +1345,7 @@ int sst_hsw_stream_reset(struct sst_hsw *hsw, struct sst_hsw_stream *stream)
return 0;

/* wait for pause to complete before we reset the stream */
- while (stream->running && tries--)
+ while (stream->running && --tries)
msleep(1);
if (!tries) {
dev_err(hsw->dev, "error: reset stream %d still running\n",


2016-04-07 01:14:22

by Keyon Jie

[permalink] [raw]
Subject: Re: [alsa-devel] [patch] ASoC: Intel: sst: fix a loop timeout in sst_hsw_stream_reset()


On 2016年04月06日 19:36, Dan Carpenter wrote:
> In the original code we ended the loop with tries set to -1 instead of
> zero.
>
> Signed-off-by: Dan Carpenter <[email protected]>

Acked-by: Jie Yang <[email protected]>

Dan, thanks for finding and correcting it.

Thanks,
~Keyon

> ---
> Not tested.
>
> diff --git a/sound/soc/intel/haswell/sst-haswell-ipc.c b/sound/soc/intel/haswell/sst-haswell-ipc.c
> index ac60f13..9156522 100644
> --- a/sound/soc/intel/haswell/sst-haswell-ipc.c
> +++ b/sound/soc/intel/haswell/sst-haswell-ipc.c
> @@ -1345,7 +1345,7 @@ int sst_hsw_stream_reset(struct sst_hsw *hsw, struct sst_hsw_stream *stream)
> return 0;
>
> /* wait for pause to complete before we reset the stream */
> - while (stream->running && tries--)
> + while (stream->running && --tries)
> msleep(1);
> if (!tries) {
> dev_err(hsw->dev, "error: reset stream %d still running\n",
> _______________________________________________
> Alsa-devel mailing list
> [email protected]
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>