[SRU][R][PATCH 08/18] ASoC: SDCA: bug fix while parsing mipi-sdca-control-cn-list

Chris Chiu chris.chiu at canonical.com
Tue Mar 17 05:21:53 UTC 2026


From: Niranjan H Y <niranjan.hy at ti.com>

BugLink: https://bugs.launchpad.net/bugs/2139391

"struct sdca_control" declares "values" field as integer array.
But the memory allocated to it is of char array. This causes
crash for sdca_parse_function API. This patch addresses the
issue by allocating correct data size.

Signed-off-by: Niranjan H Y <niranjan.hy at ti.com>
Reviewed-by: Charles Keepax <ckeepax at opensource.cirrus.com>
Link: https://patch.msgid.link/20251110152646.192-1-niranjan.hy@ti.com
Signed-off-by: Mark Brown <broonie at kernel.org>
(cherry picked from commit eb2d6774cc0d9d6ab8f924825695a85c14b2e0c2)
Signed-off-by: Chris Chiu <chris.chiu at canonical.com>
---
 sound/soc/sdca/sdca_functions.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sdca/sdca_functions.c b/sound/soc/sdca/sdca_functions.c
index 2f670ce75a29..f11523c05525 100644
--- a/sound/soc/sdca/sdca_functions.c
+++ b/sound/soc/sdca/sdca_functions.c
@@ -949,7 +949,8 @@ static int find_sdca_entity_control(struct device *dev, struct sdca_entity *enti
 		return ret;
 	}
 
-	control->values = devm_kzalloc(dev, hweight64(control->cn_list), GFP_KERNEL);
+	control->values = devm_kcalloc(dev, hweight64(control->cn_list),
+				       sizeof(int), GFP_KERNEL);
 	if (!control->values)
 		return -ENOMEM;
 
-- 
2.43.0




More information about the kernel-team mailing list