Patch "ASoC: qcom: q6dsp: Fix an off-by-one in q6adm_alloc_copp()" has been added to the 5.18-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

    ASoC: qcom: q6dsp: Fix an off-by-one in q6adm_alloc_copp()

to the 5.18-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:
     asoc-qcom-q6dsp-fix-an-off-by-one-in-q6adm_alloc_cop.patch
and it can be found in the queue-5.18 subdirectory.

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



commit 43a27c720bd5992d452bc3bcf744480dfe1b7823
Author: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Date:   Thu Jul 21 11:02:22 2022 +0200

    ASoC: qcom: q6dsp: Fix an off-by-one in q6adm_alloc_copp()
    
    [ Upstream commit 673f58f62ca6fc98979d1cf3fe89c3ff33f29b2e ]
    
    find_first_zero_bit() returns MAX_COPPS_PER_PORT at max here.
    So 'idx' should be tested with ">=" or the test can't match.
    
    Fixes: 7b20b2be51e1 ("ASoC: qdsp6: q6adm: Add q6adm driver")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/0fca3271649736053eb9649d87e1ca01b056be40.1658394124.git.christophe.jaillet@xxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/soc/qcom/qdsp6/q6adm.c b/sound/soc/qcom/qdsp6/q6adm.c
index 72c5719f1d25..a0678e8cf20a 100644
--- a/sound/soc/qcom/qdsp6/q6adm.c
+++ b/sound/soc/qcom/qdsp6/q6adm.c
@@ -217,7 +217,7 @@ static struct q6copp *q6adm_alloc_copp(struct q6adm *adm, int port_idx)
 	idx = find_first_zero_bit(&adm->copp_bitmap[port_idx],
 				  MAX_COPPS_PER_PORT);
 
-	if (idx > MAX_COPPS_PER_PORT)
+	if (idx >= MAX_COPPS_PER_PORT)
 		return ERR_PTR(-EBUSY);
 
 	c = kzalloc(sizeof(*c), GFP_ATOMIC);



[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