summaryrefslogtreecommitdiffstats
path: root/drivers/sbus/char/jsflash.c
diff options
context:
space:
mode:
authorStoyan Gaydarov <stoyboyker@gmail.com>2009-04-14 19:46:19 -0700
committerDavid S. Miller <davem@davemloft.net>2009-04-14 19:46:19 -0700
commit6c0f8bc77233d000a34a01989c42e650c8c32180 (patch)
tree9262d2e1467e09030ef9e8fe860c718aa7a64e1f /drivers/sbus/char/jsflash.c
parentc7cb1521b3289e2d107d3139ad7a902b386d7e43 (diff)
sbus: changed ioctls to unlocked
Signed-off-by: Stoyan Gaydarov <stoyboyker@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/sbus/char/jsflash.c')
-rw-r--r--drivers/sbus/char/jsflash.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/sbus/char/jsflash.c b/drivers/sbus/char/jsflash.c
index e6d1fc8c54f..a85ad05e854 100644
--- a/drivers/sbus/char/jsflash.c
+++ b/drivers/sbus/char/jsflash.c
@@ -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);
@@ -404,6 +408,7 @@ static int jsf_ioctl(struct inode *inode, struct file *f, unsigned int cmd,
break;
}
+ unlock_kernel();
return error;
}
@@ -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,