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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:49 +0000 (15:35 -0800)
commit3ef1130deee98997275904d9bfc37af75e1e906c
tree642bbd5142d420e31f49916d7b9ad0234ddc3bed
parent9fc58cb20765170817ba87d3b5e5cff9983c7d76
mfd: syscon: Fix null pointer dereference in of_syscon_register()

[ Upstream commit 41673c66b3d0c09915698fec5c13b24336f18dd1 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mfd/syscon.c