[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5f9a040e-c0d9-4dca-902d-74bc043d90c5@sirena.org.uk>
Date: Thu, 31 Jul 2025 17:20:06 +0100
From: Mark Brown <broonie@...nel.org>
To: Simon Trimmer <simont@...nsource.cirrus.com>
Cc: linux-spi@...r.kernel.org, linux-sound@...r.kernel.org,
linux-kernel@...r.kernel.org, patches@...nsource.cirrus.com
Subject: Re: [PATCH] spi: cs42l43: Property entry should be a null-terminated
array
On Thu, Jul 31, 2025 at 04:01:09PM +0000, Simon Trimmer wrote:
> 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.
> if (spkid >= 0) {
> - props = devm_kmalloc(priv->dev, sizeof(*props), GFP_KERNEL);
> + props = devm_kcalloc(priv->dev, 2, sizeof(*props), GFP_KERNEL);
Does kcalloc() zero initialise the data?
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists