]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: uclogic: Fix regression of input name assignment
authorTakashi Iwai <tiwai@suse.de>
Tue, 28 Apr 2026 08:33:16 +0000 (10:33 +0200)
committerJiri Kosina <jkosina@suse.com>
Tue, 28 Apr 2026 16:37:01 +0000 (18:37 +0200)
The previous fix for adding the devm_kasprintf() return check in the
commit bd07f751208b ("HID: uclogic: Add NULL check in
uclogic_input_configured()") changed the condition of hi->input->name
assignment, and it resulted in missing the proper input device name
when no custom suffix is defined.

Restore the conditional to the original content to address the
regression.

Fixes: bd07f751208b ("HID: uclogic: Add NULL check in uclogic_input_configured()")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-uclogic-core.c

index bd7f93e96e4e48f15551eb6ed2ac85d8be66c884..b73f09d26688ab06c3edc2f9f93f82b2779a05b9 100644 (file)
@@ -184,7 +184,9 @@ static int uclogic_input_configured(struct hid_device *hdev,
                        suffix = "System Control";
                        break;
                }
-       } else {
+       }
+
+       if (suffix) {
                hi->input->name = devm_kasprintf(&hdev->dev, GFP_KERNEL,
                                                 "%s %s", hdev->name, suffix);
                if (!hi->input->name)