Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363898
b: refs/heads/master
c: a649a67
h: refs/heads/master
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Apr 5, 2013
1 parent 390f4be commit 474f281
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ca7da6e8234c864c8694237c26e4d574b9fd00a
refs/heads/master: a649a6754d246d5b5447f74b86ed4b947e5f5446
10 changes: 10 additions & 0 deletions trunk/drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -2256,10 +2256,20 @@ static void comedi_device_init(struct comedi_device *dev)

static void comedi_device_cleanup(struct comedi_device *dev)
{
struct module *driver_module = NULL;

if (dev == NULL)
return;
mutex_lock(&dev->mutex);
if (dev->attached)
driver_module = dev->driver->module;
comedi_device_detach(dev);
while (dev->use_count > 0) {
if (driver_module)
module_put(driver_module);
module_put(THIS_MODULE);
dev->use_count--;
}
mutex_unlock(&dev->mutex);
mutex_destroy(&dev->mutex);
}
Expand Down

0 comments on commit 474f281

Please sign in to comment.