Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1641722
| From | Takashi Sakamoto <o-takashi@sakamocchi.jp> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] ALSA: firewire-tascam: Fix infinite loop in snd_tscm_stream_get_rate() |
| Date | 2017-05-15 16:10 +0200 |
| Message-ID | <tHoRc-KQ-19@gated-at.bofh.it> (permalink) |
| References | <tHjou-5y7-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi,
On May 15 2017 17:19, Geert Uytterhoeven wrote:
> Obviously the intention was to put a limit on the maximum number of
> operations. However, for this to work, the check should be
> "&& trials++ < 5", not "|| trials++ < 5".
>
> Fixes: 35efa5c489de63a9 ("ALSA: firewire-tascam: add streaming functionality")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> Compile-tested only.
>
> Triggered by a false-positive warning from gcc-4.1.2:
>
> warning: ‘err’ may be used uninitialized in this function
> ---
> sound/firewire/tascam/tascam-stream.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/firewire/tascam/tascam-stream.c b/sound/firewire/tascam/tascam-stream.c
> index f1657a4e0621ef49..e433b92ac6904db5 100644
> --- a/sound/firewire/tascam/tascam-stream.c
> +++ b/sound/firewire/tascam/tascam-stream.c
> @@ -84,7 +84,7 @@ int snd_tscm_stream_get_rate(struct snd_tscm *tscm, unsigned int *rate)
> unsigned int trials = 0;
> int err;
>
> - while (data == 0x0 || trials++ < 5) {
> + while (data == 0x0 && trials++ < 5) {
> err = get_clock(tscm, &data);
> if (err < 0)
> return err;
Yep. It looks a bug.
...However, removal of the bug causes issue that the driver fails to
start a pair of capture/playback PCM substream when application requests
them mostly the same time, like jackd process.
I think I did apply the bug as a makeshift workaround, then forgot
itself when developing the driver... I'd like to have a bit time for
further investigation, then post my fix in this development period.
Please let me keep this patch pending.
Thanks
Takashi Sakamoto
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/2] ALSA: firewire-tascam: Fix infinite loop in snd_tscm_stream_get_rate() Geert Uytterhoeven <geert@linux-m68k.org> - 2017-05-15 10:20 +0200
[PATCH 2/2] ALSA: firewire-tascam: Use do { } while for loops executed at least once Geert Uytterhoeven <geert@linux-m68k.org> - 2017-05-15 10:20 +0200
Re: [PATCH 1/2] ALSA: firewire-tascam: Fix infinite loop in snd_tscm_stream_get_rate() Takashi Sakamoto <o-takashi@sakamocchi.jp> - 2017-05-15 16:10 +0200
Re: [PATCH 1/2] ALSA: firewire-tascam: Fix infinite loop in snd_tscm_stream_get_rate() Geert Uytterhoeven <geert@linux-m68k.org> - 2017-05-15 16:30 +0200
Re: [PATCH 1/2] ALSA: firewire-tascam: Fix infinite loop in snd_tscm_stream_get_rate() Takashi Sakamoto <o-takashi@sakamocchi.jp> - 2017-05-15 16:50 +0200
csiph-web