Skip to content

Commit 9e55f11

Browse files
shumingfanbroonie
authored andcommitted
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>
1 parent d312962 commit 9e55f11

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/soc/sdca/sdca_functions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static int find_sdca_init_table(struct device *dev,
211211
} else if (num_init_writes % sizeof(*raw) != 0) {
212212
dev_err(dev, "%pfwP: init table size invalid\n", function_node);
213213
return -EINVAL;
214-
} else if (num_init_writes > SDCA_MAX_INIT_COUNT) {
214+
} else if ((num_init_writes / sizeof(*raw)) > SDCA_MAX_INIT_COUNT) {
215215
dev_err(dev, "%pfwP: maximum init table size exceeded\n", function_node);
216216
return -EINVAL;
217217
}

0 commit comments

Comments
 (0)