Loading
powerpc/powernv: Add a null pointer check to scom_debug_init_one()
stable inclusion from stable-v5.10.209 commit 1eefa93faf69188540b08b024794fa90b1d82e8b category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9Q9HJ CVE: CVE-2023-52690 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=1eefa93faf69188540b08b024794fa90b1d82e8b -------------------------------- [ Upstream commit 9a260f2dd827bbc82cc60eb4f4d8c22707d80742 ] kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Add a null pointer check, and release 'ent' to avoid memory leaks. Fixes: bfd2f0d4 ("powerpc/powernv: Get rid of old scom_controller abstraction") Signed-off-by:Kunwu Chan <chentao@kylinos.cn> Signed-off-by:
Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20231208085937.107210-1-chentao@kylinos.cn Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Cai Xinchen <caixinchen1@huawei.com>