]> git.hungrycats.org Git - linux/commit
clk: cdce925: check return value of kasprintf()
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Tue, 30 May 2023 09:39:07 +0000 (12:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jul 2023 17:39:43 +0000 (19:39 +0200)
commit13a967f32833a5d4e6750b7b3e2a8b53fc1c3513
tree25a2897b627da6dc3aeb3849ae153afd5f3d4330
parent00e768509d1292d6fcc6a62647a86db7332bc83b
clk: cdce925: check return value of kasprintf()

[ Upstream commit bb7d09ddbf361d51eae46f38e7c8a2b85914ea2a ]

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: 19fbbbbcd3a3 ("Add TI CDCE925 I2C controlled clock synthesizer driver")
Depends-on: e665f029a283 ("clk: Convert to using %pOFn instead of device_node.name")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230530093913.1656095-3-claudiu.beznea@microchip.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/clk-cdce925.c