powerpc/xics: Check return value of kasprintf in icp_native_map_one_cpu
authorKunwu Chan <chentao@kylinos.cn>
Wed, 22 Nov 2023 03:06:51 +0000 (11:06 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 27 Nov 2023 11:01:15 +0000 (22:01 +1100)
commit45b1ba7e5d1f6881050d558baf9bc74a2ae13930
treee72b8e446c86aa24cad6cdc60636221b887b41a5
parent1b1e38002648819c04773647d5242990e2824264
powerpc/xics: Check return value of kasprintf in icp_native_map_one_cpu

kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure. Ensure the allocation was successful
by checking the pointer validity.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231122030651.3818-1-chentao@kylinos.cn
arch/powerpc/sysdev/xics/icp-native.c