From: Sasha Levin Date: Sun, 12 Feb 2023 19:48:37 +0000 (-0500) Subject: Fixes for 4.14 X-Git-Tag: v6.1.12~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3784e8570523eaf35b64f7ce4e52144ba1eaeb4a;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.14 Signed-off-by: Sasha Levin --- diff --git a/queue-4.14/alsa-pci-lx6464es-fix-a-debug-loop.patch b/queue-4.14/alsa-pci-lx6464es-fix-a-debug-loop.patch new file mode 100644 index 00000000000..60703884388 --- /dev/null +++ b/queue-4.14/alsa-pci-lx6464es-fix-a-debug-loop.patch @@ -0,0 +1,52 @@ +From 16fb648fba45a56aa26a441a13fa6d6e90bf0f58 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 31 Jan 2023 13:02:13 +0300 +Subject: ALSA: pci: lx6464es: fix a debug loop + +From: Dan Carpenter + +[ 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: 8e6320064c33 ("ALSA: lx_core: Remove useless #if 0 .. #endif") +Signed-off-by: Dan Carpenter +Link: https://lore.kernel.org/r/Y9jnJTis/mRFJAQp@kili +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/lx6464es/lx_core.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/sound/pci/lx6464es/lx_core.c b/sound/pci/lx6464es/lx_core.c +index a80684bdc30d6..46f5362096710 100644 +--- a/sound/pci/lx6464es/lx_core.c ++++ b/sound/pci/lx6464es/lx_core.c +@@ -508,12 +508,11 @@ int lx_buffer_ask(struct lx6464es *chip, u32 pipe, int is_capture, + dev_dbg(chip->card->dev, + "CMD_08_ASK_BUFFERS: needed %d, freed %d\n", + *r_needed, *r_freed); +- for (i = 0; i < MAX_STREAM_BUFFER; ++i) { +- for (i = 0; i != chip->rmh.stat_len; ++i) +- dev_dbg(chip->card->dev, +- " stat[%d]: %x, %x\n", i, +- chip->rmh.stat[i], +- chip->rmh.stat[i] & MASK_DATA_SIZE); ++ for (i = 0; i < MAX_STREAM_BUFFER && i < chip->rmh.stat_len; ++ ++i) { ++ dev_dbg(chip->card->dev, " stat[%d]: %x, %x\n", i, ++ chip->rmh.stat[i], ++ chip->rmh.stat[i] & MASK_DATA_SIZE); + } + } + +-- +2.39.0 + diff --git a/queue-4.14/series b/queue-4.14/series index a5e5b96dd62..bb25c4e168b 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -25,3 +25,4 @@ serial-8250_dma-fix-dma-rx-completion-race.patch serial-8250_dma-fix-dma-rx-rearm-race.patch btrfs-limit-device-extents-to-the-device-size.patch alsa-emux-avoid-potential-array-out-of-bound-in-snd_emux_xg_control.patch +alsa-pci-lx6464es-fix-a-debug-loop.patch