mfd: syscon: Fix null pointer dereference in of_syscon_register()
authorKunwu Chan <chentao@kylinos.cn>
Mon, 4 Dec 2023 09:24:43 +0000 (17:24 +0800)
committerLee Jones <lee@kernel.org>
Thu, 7 Dec 2023 16:05:11 +0000 (16:05 +0000)
commit41673c66b3d0c09915698fec5c13b24336f18dd1
treea177c10e3af7fb3b4fdc13529183c0ea1f31364c
parent0c679fffd67605a2c10a61a9a09890970eae11a9
mfd: syscon: Fix null pointer dereference in of_syscon_register()

kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure.

Fixes: e15d7f2b81d2 ("mfd: syscon: Use a unique name with regmap_config")
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20231204092443.2462115-1-chentao@kylinos.cn
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/syscon.c