This is a note to let you know that I've just added the patch titled HID: winwing: Add NULL check in winwing_init_led() to the 6.13-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: hid-winwing-add-null-check-in-winwing_init_led.patch and it can be found in the queue-6.13 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 1e95506d56bba8821ec405b2d7bdabc48b0687ae Author: Charles Han <hanchunchao@xxxxxxxxxx> Date: Thu Nov 14 17:19:47 2024 +0800 HID: winwing: Add NULL check in winwing_init_led() [ Upstream commit 45ab5166a82d038c898985b0ad43ead69c1f9573 ] devm_kasprintf() can return a NULL pointer on failure,but this returned value in winwing_init_led() is not checked. Add NULL check in winwing_init_led(), to handle kernel NULL pointer dereference error. Fixes: 266c990debad ("HID: Add WinWing Orion2 throttle support") Signed-off-by: Charles Han <hanchunchao@xxxxxxxxxx> Signed-off-by: Jiri Kosina <jkosina@xxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/hid/hid-winwing.c b/drivers/hid/hid-winwing.c index 831b760c66ea7..d4afbbd278079 100644 --- a/drivers/hid/hid-winwing.c +++ b/drivers/hid/hid-winwing.c @@ -106,6 +106,8 @@ static int winwing_init_led(struct hid_device *hdev, "%s::%s", dev_name(&input->dev), info->led_name); + if (!led->cdev.name) + return -ENOMEM; ret = devm_led_classdev_register(&hdev->dev, &led->cdev); if (ret)