[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <695e7853-dc6a-41f6-85c1-47aa78085048@opensource.cirrus.com>
Date: Wed, 19 Feb 2025 15:18:14 +0000
From: Richard Fitzgerald <rf@...nsource.cirrus.com>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
"Mark
Brown" <broonie@...nel.org>
CC: <patches@...nsource.cirrus.com>, <linux-kernel@...r.kernel.org>,
<stable@...r.kernel.org>
Subject: Re: [PATCH] firmware: cs_dsp: test_control_parse: null-terminate test
strings
On 11/02/2025 3:00 pm, Thomas Weißschuh wrote:
> The char pointers in 'struct cs_dsp_mock_coeff_def' are expected to
> point to C strings. They need to be terminated by a null byte.
> However the code does not allocate that trailing null byte and only
> works if by chance the allocation is followed by such a null byte.
>
> Refactor the repeated string allocation logic into a new helper which
> makes sure the terminating null is always present.
> It also makes the code more readable.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
> Fixes: 83baecd92e7c ("firmware: cs_dsp: Add KUnit testing of control parsing")
> Cc: stable@...r.kernel.org
> ---
> .../cirrus/test/cs_dsp_test_control_parse.c | 51 ++++++++--------------
> 1 file changed, 19 insertions(+), 32 deletions(-)
>
Reviewed-by: Richard Fitzgerald <rf@...nsource.cirrus.com>
Tested-by: Richard Fitzgerald <rf@...nsource.cirrus.com>
Powered by blists - more mailing lists