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 <[email protected]> Reviewed-by: Charles Keepax <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent d312962 commit 9e55f11

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)