misc: fastrpc: check return value of devm_kasprintf()
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Thu, 15 Jun 2023 10:25:46 +0000 (13:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:21:58 +0000 (16:21 +0200)
commit94f3bcfcd17c7e932e2431dbbc7b172d4b647c11
treed1b4c6bb327485241357a660c669fbaa18fff309
parent7e3ee25e8c7c7be1eacdfc6d9f5f0e550a2af241
misc: fastrpc: check return value of devm_kasprintf()

[ Upstream commit af2e19d82a116bc622eea84c9faadd5f7e20bec4 ]

devm_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: 3abe3ab3cdab ("misc: fastrpc: add secure domain support")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230615102546.581899-1-claudiu.beznea@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/fastrpc.c