1
0
Fork 0

staging: comedi: usbdux: Call mutex_destroy() on private mutex

`usbdux_detach()` is the Comedi "detach" handler for the usbdux driver.
When it is called, the private data for the device is about to be freed.
The private date contains a mutex `devpriv->mut` that was initialized
when the private data was allocated.  Call `mutex_destroy()` to mark it
as invalid.

The calls to `mutex_lock()` and `mutex_unlock()` are probably not
required, especially as the mutex is about to be destroyed, but leave
them alone for now.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
hifive-unleashed-5.2
Ian Abbott 2019-04-17 16:44:25 +01:00 committed by Greg Kroah-Hartman
parent 35756f3dbf
commit 3c03c470f4
1 changed files with 2 additions and 0 deletions

View File

@ -1691,6 +1691,8 @@ static void usbdux_detach(struct comedi_device *dev)
usbdux_free_usb_buffers(dev);
mutex_unlock(&devpriv->mut);
mutex_destroy(&devpriv->mut);
}
static struct comedi_driver usbdux_driver = {