[PATCH] HID: uclogic: Fix regression of input name assignment

Takashi Iwai posted 1 patch 1 month, 2 weeks ago
drivers/hid/hid-uclogic-core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
[PATCH] HID: uclogic: Fix regression of input name assignment
Posted by Takashi Iwai 1 month, 2 weeks ago
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>
---
 drivers/hid/hid-uclogic-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-uclogic-core.c b/drivers/hid/hid-uclogic-core.c
index bd7f93e96e4e..b73f09d26688 100644
--- a/drivers/hid/hid-uclogic-core.c
+++ b/drivers/hid/hid-uclogic-core.c
@@ -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)
-- 
2.54.0
Re: [PATCH] HID: uclogic: Fix regression of input name assignment
Posted by Jiri Kosina 1 month, 2 weeks ago
On Tue, 28 Apr 2026, Takashi Iwai wrote:

> 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>

Applied to hid.git#for-7.1/upstream-fixes, thanks Takashi.

-- 
Jiri Kosina
SUSE Labs