Patch "ALSA: pci: lx6464es: fix a debug loop" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ALSA: pci: lx6464es: fix a debug loop

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     alsa-pci-lx6464es-fix-a-debug-loop.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit cf4e08bab5099b5df64699ec1c51217829627e83
Author: Dan Carpenter <error27@xxxxxxxxx>
Date:   Tue Jan 31 13:02:13 2023 +0300

    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: 8e6320064c33 ("ALSA: lx_core: Remove useless #if 0 .. #endif")
    Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>
    Link: https://lore.kernel.org/r/Y9jnJTis/mRFJAQp@kili
    Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/pci/lx6464es/lx_core.c b/sound/pci/lx6464es/lx_core.c
index d3f58a3d17fbc..b5b0d43bb8dcd 100644
--- a/sound/pci/lx6464es/lx_core.c
+++ b/sound/pci/lx6464es/lx_core.c
@@ -493,12 +493,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);
 		}
 	}
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux