]> git.ipfire.org Git - thirdparty/kernel/stable.git/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>
Thu, 27 Jul 2023 06:37:15 +0000 (08:37 +0200)
commitffe6ad17cf14722e02d09e62bca675c97e81a60b
tree077681d7ad3fe7e11f78b9caac36df29c5c27c9f
parent5f13d67027fa782096e6aee0db5dce61c4aeb613
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