diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2019-04-17 18:44:25 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-19 15:59:37 +0300 |
commit | 3c03c470f476957d318ea49b7eeb9bcf3cb8b1e9 (patch) | |
tree | 2ed19afd472ab2e4201cc82dcea12d70925c531b /drivers | |
parent | 35756f3dbf4347b8e4b7dcd781da887cafab4786 (diff) | |
download | linux-3c03c470f476957d318ea49b7eeb9bcf3cb8b1e9.tar.xz |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/comedi/drivers/usbdux.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/comedi/drivers/usbdux.c b/drivers/staging/comedi/drivers/usbdux.c index de177418190f..b8f54b7fb34a 100644 --- a/drivers/staging/comedi/drivers/usbdux.c +++ b/drivers/staging/comedi/drivers/usbdux.c @@ -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 = { |