Home
last modified time | relevance | path

Searched hist:"2 f86a96be0ccb1302b7eee7855dbee5ce4dc5dfb" (Results 1 – 1 of 1) sorted by relevance

/linux/drivers/usb/core/
H A Dfile.cdiff 2f86a96be0ccb1302b7eee7855dbee5ce4dc5dfb Tue Mar 28 14:09:32 CEST 2017 Ajay Kaher <ajay.kaher@samsung.com> USB: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

There is race condition when two USB class drivers try to call
init_usb_class at the same time and leads to crash.
code path: probe->usb_register_dev->init_usb_class

To solve this, mutex locking has been added in init_usb_class() and
destroy_usb_class().

As pointed by Alan, removed "if (usb_class)" test from destroy_usb_class()
because usb_class can never be NULL there.

Signed-off-by: Ajay Kaher <ajay.kaher@samsung.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>