Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363931
b: refs/heads/master
c: db210da
h: refs/heads/master
i:
  363929: bc0043c
  363927: 98b2e04
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Apr 5, 2013
1 parent 2bebcaa commit 7d32eb1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c6f5b4d587a46fc0713cecc30ef3993c59b7e41e
refs/heads/master: db210da268ec537f8944ea5bc490184a6707c8a2
18 changes: 15 additions & 3 deletions trunk/drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ static void comedi_device_cleanup(struct comedi_device *dev)
mutex_destroy(&dev->mutex);
}

static bool comedi_clear_board_dev(struct comedi_device *dev)
{
unsigned int i = dev->minor;
bool cleared = false;

mutex_lock(&comedi_board_minor_table_lock);
if (dev == comedi_board_minor_table[i]) {
comedi_board_minor_table[i] = NULL;
cleared = true;
}
mutex_unlock(&comedi_board_minor_table_lock);
return cleared;
}

static struct comedi_device *comedi_clear_board_minor(unsigned minor)
{
struct comedi_device *dev;
Expand Down Expand Up @@ -1766,9 +1780,7 @@ static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd,
dev->minor >= comedi_num_legacy_minors) {
/* Successfully unconfigured a dynamically
* allocated device. Try and remove it. */
struct comedi_device *devr;
devr = comedi_clear_board_minor(dev->minor);
if (dev == devr) {
if (comedi_clear_board_dev(dev)) {
mutex_unlock(&dev->mutex);
comedi_free_board_dev(dev);
return rc;
Expand Down

0 comments on commit 7d32eb1

Please sign in to comment.