summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiranjan H Y <niranjan.hy@ti.com>2025-11-10 18:26:46 +0300
committerMark Brown <broonie@kernel.org>2025-11-10 19:22:49 +0300
commiteb2d6774cc0d9d6ab8f924825695a85c14b2e0c2 (patch)
treebf76e513378663f3d0d4eb1c02b48bbabdfe14d3
parent29528c8e643bb0c54da01237a35010c6438423d2 (diff)
downloadlinux-eb2d6774cc0d9d6ab8f924825695a85c14b2e0c2.tar.xz
ASoC: SDCA: bug fix while parsing mipi-sdca-control-cn-list
"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@ti.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251110152646.192-1-niranjan.hy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/sdca/sdca_functions.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/sdca/sdca_functions.c b/sound/soc/sdca/sdca_functions.c
index 13f68f7b6dd6..0ccb6775f4de 100644
--- a/sound/soc/sdca/sdca_functions.c
+++ b/sound/soc/sdca/sdca_functions.c
@@ -894,7 +894,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;