summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShuming Fan <shumingf@realtek.com>2025-07-21 19:23:34 +0800
committerMark Brown <broonie@kernel.org>2025-07-21 16:04:47 +0100
commit9e55f1192648a5b327f03c60e411126b3d19c5c5 (patch)
tree4ae749825c7a131a0ea55b9cb8223ef45b4ec8aa
parentd312962188dd1f682b0351ccf9933334738ac462 (diff)
ASoC: SDCA: correct the calculation of the maximum init table size
One initial setting is 5 bytes, so num_init_writes should divide by 5. Signed-off-by: Shuming Fan <shumingf@realtek.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20250721112334.388506-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/sdca/sdca_functions.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/sdca/sdca_functions.c b/sound/soc/sdca/sdca_functions.c
index 64ac26443890..de213a69e0da 100644
--- a/sound/soc/sdca/sdca_functions.c
+++ b/sound/soc/sdca/sdca_functions.c
@@ -211,7 +211,7 @@ static int find_sdca_init_table(struct device *dev,
} else if (num_init_writes % sizeof(*raw) != 0) {
dev_err(dev, "%pfwP: init table size invalid\n", function_node);
return -EINVAL;
- } else if (num_init_writes > SDCA_MAX_INIT_COUNT) {
+ } else if ((num_init_writes / sizeof(*raw)) > SDCA_MAX_INIT_COUNT) {
dev_err(dev, "%pfwP: maximum init table size exceeded\n", function_node);
return -EINVAL;
}