powerpc/83xx: Add a null pointer check to mcu_gpiochip_add

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: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20240115094330.33014-1-chentao@kylinos.cn
This commit is contained in:
Kunwu Chan 2024-01-15 17:43:30 +08:00 • committed by Madhavan Srinivasan
commit 2617bd81ae