Skip to content

Commit 9f3ccdc

Browse files
pskrgagdtor
authored andcommitted
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: 5a6eb67 ("Input: appletouch - improve powersaving for Geyser3 devices") Reported-and-tested-by: [email protected] Signed-off-by: Pavel Skripkin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 4ebfee2 commit 9f3ccdc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/input/mouse/appletouch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -916,15 +916,15 @@ static int atp_probe(struct usb_interface *iface,
916916
set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit);
917917
set_bit(BTN_LEFT, input_dev->keybit);
918918

919+
INIT_WORK(&dev->work, atp_reinit);
920+
919921
error = input_register_device(dev->input);
920922
if (error)
921923
goto err_free_buffer;
922924

923925
/* save our data pointer in this interface device */
924926
usb_set_intfdata(iface, dev);
925927

926-
INIT_WORK(&dev->work, atp_reinit);
927-
928928
return 0;
929929

930930
err_free_buffer:

0 commit comments

Comments
 (0)