HID: nvidia-shield: Add missing null pointer checks to LED initialization
authorKunwu Chan <chentao@kylinos.cn>
Fri, 19 Jan 2024 06:07:14 +0000 (14:07 +0800)
committerJiri Kosina <jkosina@suse.com>
Tue, 23 Jan 2024 10:22:42 +0000 (11:22 +0100)
commitb6eda11c44dc89a681e1c105f0f4660e69b1e183
tree9f266658dbcdb138be305e8a084f1d88adbd33a1
parentafa6ac2690bb9904ff883c6e942281e1032a484d
HID: nvidia-shield: Add missing null pointer checks to LED initialization

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

[jkosina@suse.com: tweak changelog a bit]
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-nvidia-shield.c