]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: pci: lx6464es: fix a debug loop
authorDan Carpenter <error27@gmail.com>
Tue, 31 Jan 2023 10:02:13 +0000 (13:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Feb 2023 11:50:32 +0000 (12:50 +0100)
commit4619f465d02be83a6dec38425ab66f420ffdd807
treeda1c6b77d6e692e2a38b12ba43aa672b25cd015e
parentdaffdb681d7f06c6a4e254179441e62cc5b66356
ALSA: pci: lx6464es: fix a debug loop

[ Upstream commit 5dac9f8dc25fefd9d928b98f6477ff3daefd73e3 ]

This loop accidentally reuses the "i" iterator for both the inside and
the outside loop.  The value of MAX_STREAM_BUFFER is 5.  I believe that
chip->rmh.stat_len is in the 2-12 range.  If the value of .stat_len is
4 or more then it will loop exactly one time, but if it's less then it
is a forever loop.

It looks like it was supposed to combined into one loop where
conditions are checked.

Fixes: ecec7f5b7c31 ("ALSA: lx_core: Remove useless #if 0 .. #endif")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/Y9jnJTis/mRFJAQp@kili
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/pci/lx6464es/lx_core.c