Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143407
b: refs/heads/master
c: 6c0f8bc
h: refs/heads/master
i:
  143405: b9fcaeb
  143403: 3f01577
  143399: 750e068
  143391: f73f03c
v: v3
  • Loading branch information
Stoyan Gaydarov authored and David S. Miller committed Apr 15, 2009
1 parent e72e9a7 commit c936c07
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 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: c7cb1521b3289e2d107d3139ad7a902b386d7e43
refs/heads/master: 6c0f8bc77233d000a34a01989c42e650c8c32180
15 changes: 10 additions & 5 deletions trunk/drivers/sbus/char/jsflash.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,18 +383,22 @@ static int jsf_ioctl_program(void __user *arg)
return 0;
}

static int jsf_ioctl(struct inode *inode, struct file *f, unsigned int cmd,
unsigned long arg)
static long jsf_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
{
lock_kernel();
int error = -ENOTTY;
void __user *argp = (void __user *)arg;

if (!capable(CAP_SYS_ADMIN))
if (!capable(CAP_SYS_ADMIN)) {
unlock_kernel();
return -EPERM;
}
switch (cmd) {
case JSFLASH_IDENT:
if (copy_to_user(argp, &jsf0.id, JSFIDSZ))
if (copy_to_user(argp, &jsf0.id, JSFIDSZ)) {
unlock_kernel();
return -EFAULT;
}
break;
case JSFLASH_ERASE:
error = jsf_ioctl_erase(arg);
Expand All @@ -404,6 +408,7 @@ static int jsf_ioctl(struct inode *inode, struct file *f, unsigned int cmd,
break;
}

unlock_kernel();
return error;
}

Expand Down Expand Up @@ -439,7 +444,7 @@ static const struct file_operations jsf_fops = {
.llseek = jsf_lseek,
.read = jsf_read,
.write = jsf_write,
.ioctl = jsf_ioctl,
.unlocked_ioctl = jsf_ioctl,
.mmap = jsf_mmap,
.open = jsf_open,
.release = jsf_release,
Expand Down
7 changes: 3 additions & 4 deletions trunk/drivers/sbus/char/uctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,8 @@ static struct uctrl_driver {
static void uctrl_get_event_status(struct uctrl_driver *);
static void uctrl_get_external_status(struct uctrl_driver *);

static int
uctrl_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
static long
uctrl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
switch (cmd) {
default:
Expand All @@ -226,7 +225,7 @@ static irqreturn_t uctrl_interrupt(int irq, void *dev_id)
static const struct file_operations uctrl_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.ioctl = uctrl_ioctl,
.unlocked_ioctl = uctrl_ioctl,
.open = uctrl_open,
};

Expand Down

0 comments on commit c936c07

Please sign in to comment.