Skip to content

Commit ffcfd07

Browse files
simontrimmerbroonie
authored andcommitted
spi: cs42l43: Property entry should be a null-terminated array
The software node does not specify a count of property entries, so the array must be null-terminated. When unterminated, this can lead to a fault in the downstream cs35l56 amplifier driver, because the node parse walks off the end of the array into unknown memory. Fixes: 0ca645a ("spi: cs42l43: Add speaker id support to the bridge configuration") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220371 Signed-off-by: Simon Trimmer <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 926406a commit ffcfd07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-cs42l43.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static struct spi_board_info *cs42l43_create_bridge_amp(struct cs42l43_spi *priv
295295
struct spi_board_info *info;
296296

297297
if (spkid >= 0) {
298-
props = devm_kmalloc(priv->dev, sizeof(*props), GFP_KERNEL);
298+
props = devm_kcalloc(priv->dev, 2, sizeof(*props), GFP_KERNEL);
299299
if (!props)
300300
return NULL;
301301

0 commit comments

Comments
 (0)