Commit 35756f3d authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

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

`usbduxfast_detach()` is the Comedi "detach" handler for the usbduxfast
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()` in
`usbduxfast_detach()` are probably not required, especially as the mutex
is about to be destroyed, but leave them alone for now.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2cd08696
...@@ -993,6 +993,8 @@ static void usbduxfast_detach(struct comedi_device *dev) ...@@ -993,6 +993,8 @@ static void usbduxfast_detach(struct comedi_device *dev)
kfree(devpriv->duxbuf); kfree(devpriv->duxbuf);
mutex_unlock(&devpriv->mut); mutex_unlock(&devpriv->mut);
mutex_destroy(&devpriv->mut);
} }
static struct comedi_driver usbduxfast_driver = { static struct comedi_driver usbduxfast_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment