]> git.hungrycats.org Git - linux/commit
clk: vc5: check memory returned by kasprintf()
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Tue, 30 May 2023 09:39:06 +0000 (12:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jul 2023 17:39:43 +0000 (19:39 +0200)
commit00e768509d1292d6fcc6a62647a86db7332bc83b
treefde52d9419e59e1e25e56911dc317dcb23d7eeae
parent5c736cac92acc0dac514409d8956dc4b60a27250
clk: vc5: check memory returned by kasprintf()

[ Upstream commit 144601f6228de5598f03e693822b60a95c367a17 ]

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@microchip.com>
Link: https://lore.kernel.org/r/20230530093913.1656095-2-claudiu.beznea@microchip.com
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/clk-versaclock5.c