Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363509
b: refs/heads/master
c: 13f12b5
h: refs/heads/master
i:
  363507: 7b7229e
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Mar 15, 2013
1 parent bb5da95 commit 5b3d39e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 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: a7401cddcdf739d3cb9598c9b3787a732fc87809
refs/heads/master: 13f12b5aea501bce146cdf213d1819083aadc847
12 changes: 6 additions & 6 deletions trunk/drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -2067,12 +2067,12 @@ static int comedi_open(struct inode *inode, struct file *file)
/* This is slightly hacky, but we want module autoloading
* to work for root.
* case: user opens device, attached -> ok
* case: user opens device, unattached, in_request_module=0 -> autoload
* case: user opens device, unattached, in_request_module=1 -> fail
* case: user opens device, unattached, !in_request_module -> autoload
* case: user opens device, unattached, in_request_module -> fail
* case: root opens device, attached -> ok
* case: root opens device, unattached, in_request_module=1 -> ok
* case: root opens device, unattached, in_request_module -> ok
* (typically called from modprobe)
* case: root opens device, unattached, in_request_module=0 -> autoload
* case: root opens device, unattached, !in_request_module -> autoload
*
* The last could be changed to "-> ok", which would deny root
* autoloading.
Expand All @@ -2088,15 +2088,15 @@ static int comedi_open(struct inode *inode, struct file *file)
if (capable(CAP_NET_ADMIN) && dev->in_request_module)
goto ok;

dev->in_request_module = 1;
dev->in_request_module = true;

#ifdef CONFIG_KMOD
mutex_unlock(&dev->mutex);
request_module("char-major-%i-%i", COMEDI_MAJOR, dev->minor);
mutex_lock(&dev->mutex);
#endif

dev->in_request_module = 0;
dev->in_request_module = false;

if (!dev->attached && !capable(CAP_NET_ADMIN)) {
DPRINTK("not attached and not CAP_NET_ADMIN\n");
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/comedi/comedidev.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ struct comedi_device {
const char *board_name;
const void *board_ptr;
bool attached:1;
bool in_request_module:1;
spinlock_t spinlock;
struct mutex mutex;
int in_request_module;

int n_subdevices;
struct comedi_subdevice *subdevices;
Expand Down

0 comments on commit 5b3d39e

Please sign in to comment.