Input: usbtouchscreen - initialize PM mutex before using it
authorOliver Neukum <oneukum@suse.com>
Thu, 1 Aug 2019 16:40:26 +0000 (09:40 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 1 Aug 2019 17:55:20 +0000 (10:55 -0700)
Mutexes shall be initialized before they are used.

Fixes: 12e510dbc57b2 ("Input: usbtouchscreen - fix deadlock in autosuspend")
Reported-by: syzbot+199ea16c7f26418b4365@syzkaller.appspotmail.com
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/usbtouchscreen.c

index a2cec6cacf576e4a387d8f4aa2bc5ca953a66a22..16d70201de4a3334fc4dd49dc3d205ce4d96bc52 100644 (file)
@@ -1659,6 +1659,8 @@ static int usbtouch_probe(struct usb_interface *intf,
        if (!usbtouch || !input_dev)
                goto out_free;
 
+       mutex_init(&usbtouch->pm_mutex);
+
        type = &usbtouch_dev_info[id->driver_info];
        usbtouch->type = type;
        if (!type->process_pkt)