xhci: init command timeout timer earlier to avoid deleting it uninitialized
authorMathias Nyman <mathias.nyman@linux.intel.com>
Mon, 21 Sep 2015 14:46:17 +0000 (17:46 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Oct 2015 21:43:19 +0000 (14:43 -0700)
commitbc1a2e4e22baf5f6eeada5be042c208b1147fc1b
treece8cbed5cafba2878ec96878afa74ae82efe604d
parent0dee698fa202b662e9d2f8f2a44db5b2f68f44d7
xhci: init command timeout timer earlier to avoid deleting it uninitialized

commit cc8e4fc0c3b5e8340bc8358990515d116a3c274c upstream.

Don't check if timer is running with a timer_pending() before
deleting it with del_timer_sync(), this defies the whole point of
the sync part and can cause a possible race.

Instead we just want to make sure the timer is initialized early enough
before we have a chance to delete it.

Reported-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-mem.c