staging: most: usb: fix usb_disconnect race condition
authorChristian Gromm <christian.gromm@microchip.com>
Tue, 8 May 2018 09:45:15 +0000 (11:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 May 2018 11:41:51 +0000 (13:41 +0200)
commitc06b99e002d06a69174a862c0da43ce0cebfe78d
tree4fd691568995722966a20b7a09230c90104842da
parent9a32315b0b162a9ec13c41c0c69d4b93095494ca
staging: most: usb: fix usb_disconnect race condition

The functions usb_disconnect and usb_sndbulkpipe are racing for the struct
usb_device, which might cause a null pointer dereference exception. This
patch fixes this race condition by protecting the critical section inside
the function hdm_enque with the io_mutex.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/usb/usb.c