]> git.baikalelectronics.ru Git - kernel.git/commit
Input: appletouch - initialize work before device registration
authorPavel Skripkin <paskripkin@gmail.com>
Fri, 31 Dec 2021 04:57:46 +0000 (20:57 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 31 Dec 2021 05:04:04 +0000 (21:04 -0800)
commit21dd0b5932e949e2ed5ea6f99623251c3e90b979
tree5547c3618de935c018b3bf30d1f502eba14d650c
parent2f1c3945e010b088672d5f98058a554064c3a368
Input: appletouch - initialize work before device registration

Syzbot has reported warning in __flush_work(). This warning is caused by
work->func == NULL, which means missing work initialization.

This may happen, since input_dev->close() calls
cancel_work_sync(&dev->work), but dev->work initalization happens _after_
input_register_device() call.

So this patch moves dev->work initialization before registering input
device

Fixes: b118bd4d9f42 ("Input: appletouch - improve powersaving for Geyser3 devices")
Reported-and-tested-by: syzbot+b88c5eae27386b252bbd@syzkaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/20211230141151.17300-1-paskripkin@gmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/mouse/appletouch.c