[PATCH] test: hid_asus

xiaopeitux@foxmail.com posted 1 patch 1 week, 2 days ago
There is a newer version of this series
drivers/hid/hid-asus.c | 6 ++++++
1 file changed, 6 insertions(+)
[PATCH] test: hid_asus
Posted by xiaopeitux@foxmail.com 1 week, 2 days ago
From: Pei Xiao <xiaopei01@kylinos.cn>

#syz test
---
 drivers/hid/hid-asus.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 1b9793f7c07e..e799ce2ecf6c 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -361,6 +361,12 @@ static int asus_event(struct hid_device *hdev, struct hid_field *field,
 			 usage->hid & HID_USAGE);
 	}
 
+	if (drvdata->quirks & QUIRK_HID_FN_LOCK &&
+		usage->type == EV_KEY && usage->code == KEY_FN_ESC && value == 1) {
+		drvdata->fn_lock = !drvdata->fn_lock;
+		schedule_work(&drvdata->fn_lock_sync_work);
+	}
+
 	if (usage->type == EV_KEY && value) {
 		switch (usage->code) {
 		case KEY_KBDILLUMUP:
-- 
2.25.1
Re: [syzbot] [input?] [usb?] WARNING in asus_remove
Posted by syzbot 1 week, 2 days ago
Hello,

syzbot tried to test the proposed patch but the build/boot failed:

drivers/hid/hid-asus.c:364:6: error: use of undeclared identifier 'drvdata'
drivers/hid/hid-asus.c:366:3: error: use of undeclared identifier 'drvdata'
drivers/hid/hid-asus.c:366:23: error: use of undeclared identifier 'drvdata'
drivers/hid/hid-asus.c:367:18: error: use of undeclared identifier 'drvdata'


Tested on:

commit:         33a647c6 Add linux-next specific files for 20260129
git tree:       linux-next
kernel config:  https://syzkaller.appspot.com/x/.config?x=750532df2c47a03
dashboard link: https://syzkaller.appspot.com/bug?extid=13f8286fa2de04a7cd48
compiler:       Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
patch:          https://syzkaller.appspot.com/x/patch.diff?x=12d1a45a580000