]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:34:51 +0000 (13:34 +0100)
commit83527a13740f57b45f162e3af4c7db4b88521100
tree05b668209f154b217a89de8c1f23d5e88b06840f
parent034a0061b2dcf72c8276eadddb6417caf57a9d31
HID: nvidia-shield: Add missing null pointer checks to LED initialization

[ Upstream commit b6eda11c44dc89a681e1c105f0f4660e69b1e183 ]

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