Unverified Commit ffcfd071 authored by Simon Trimmer's avatar Simon Trimmer Committed by Mark Brown
Browse files

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: 0ca645ab ("spi: cs42l43: Add speaker id support to the bridge configuration")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220371


Signed-off-by: default avatarSimon Trimmer <simont@opensource.cirrus.com>
Link: https://patch.msgid.link/20250731160109.1547131-1-simont@opensource.cirrus.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 926406a8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -295,7 +295,7 @@ static struct spi_board_info *cs42l43_create_bridge_amp(struct cs42l43_spi *priv
	struct spi_board_info *info;

	if (spkid >= 0) {
		props = devm_kmalloc(priv->dev, sizeof(*props), GFP_KERNEL);
		props = devm_kcalloc(priv->dev, 2, sizeof(*props), GFP_KERNEL);
		if (!props)
			return NULL;