Re: [PATCH 1/8] clk: vc5: check memory returned by kasprintf()

From: Luca Ceresoli
Date: Wed May 31 2023 - 12:33:13 EST


Hi Claudiu,

On Tue, 30 May 2023 12:39:06 +0300
Claudiu Beznea <claudiu.beznea@xxxxxxxxxxxxx> wrote:

> kasprintf() returns a pointer to dynamically allocated memory.
> Pointer could be NULL in case allocation fails. Check pointer validity.
> Identified with coccinelle (kmerr.cocci script).
>
> Fixes: f491276a5168 ("clk: vc5: Allow Versaclock driver to support multiple instances")
> Signed-off-by: Claudiu Beznea <claudiu.beznea@xxxxxxxxxxxxx>

I think this driver would benefit a bit of refactoring, moving all
those similar sections to a single function.

But for the time being your change is fine:

Reviewed-by: Luca Ceresoli <luca.ceresoli@xxxxxxxxxxx>

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com