aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/applicom.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-24 11:01:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-24 11:01:10 -0400
commitf13771187b9423b824f32518319f6da85d819003 (patch)
treec431cf16c286065a302d5f3fb43fc1abac7e4047 /drivers/char/applicom.c
parent15953654cc312429740fd58fb37a5a3d63a54376 (diff)
parent9f37af654fda88a8dcca74c785f6c20e52758866 (diff)
Merge branch 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing
* 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing: uml: Pushdown the bkl from harddog_kern ioctl sunrpc: Pushdown the bkl from sunrpc cache ioctl sunrpc: Pushdown the bkl from ioctl autofs4: Pushdown the bkl from ioctl uml: Convert to unlocked_ioctls to remove implicit BKL ncpfs: BKL ioctl pushdown coda: Clean-up whitespace problems in pioctl.c coda: BKL ioctl pushdown drivers: Push down BKL into various drivers isdn: Push down BKL into ioctl functions scsi: Push down BKL into ioctl functions dvb: Push down BKL into ioctl functions smbfs: Push down BKL into ioctl function coda/psdev: Remove BKL from ioctl function um/mmapper: Remove BKL usage sn_hwperf: Kill BKL usage hfsplus: Push down BKL into ioctl function
Diffstat (limited to 'drivers/char/applicom.c')
-rw-r--r--drivers/char/applicom.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index a7424bf7eacf..63313a33ba5f 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -26,6 +26,7 @@
26#include <linux/sched.h> 26#include <linux/sched.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/smp_lock.h>
29#include <linux/miscdevice.h> 30#include <linux/miscdevice.h>
30#include <linux/pci.h> 31#include <linux/pci.h>
31#include <linux/wait.h> 32#include <linux/wait.h>
@@ -106,8 +107,7 @@ static unsigned int DeviceErrorCount; /* number of device error */
106 107
107static ssize_t ac_read (struct file *, char __user *, size_t, loff_t *); 108static ssize_t ac_read (struct file *, char __user *, size_t, loff_t *);
108static ssize_t ac_write (struct file *, const char __user *, size_t, loff_t *); 109static ssize_t ac_write (struct file *, const char __user *, size_t, loff_t *);
109static int ac_ioctl(struct inode *, struct file *, unsigned int, 110static long ac_ioctl(struct file *, unsigned int, unsigned long);
110 unsigned long);
111static irqreturn_t ac_interrupt(int, void *); 111static irqreturn_t ac_interrupt(int, void *);
112 112
113static const struct file_operations ac_fops = { 113static const struct file_operations ac_fops = {
@@ -115,7 +115,7 @@ static const struct file_operations ac_fops = {
115 .llseek = no_llseek, 115 .llseek = no_llseek,
116 .read = ac_read, 116 .read = ac_read,
117 .write = ac_write, 117 .write = ac_write,
118 .ioctl = ac_ioctl, 118 .unlocked_ioctl = ac_ioctl,
119}; 119};
120 120
121static struct miscdevice ac_miscdev = { 121static struct miscdevice ac_miscdev = {
@@ -689,7 +689,7 @@ static irqreturn_t ac_interrupt(int vec, void *dev_instance)
689 689
690 690
691 691
692static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) 692static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
693 693
694{ /* @ ADG ou ATO selon le cas */ 694{ /* @ ADG ou ATO selon le cas */
695 int i; 695 int i;
@@ -711,7 +711,8 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
711 kfree(adgl); 711 kfree(adgl);
712 return -EFAULT; 712 return -EFAULT;
713 } 713 }
714 714
715 lock_kernel();
715 IndexCard = adgl->num_card-1; 716 IndexCard = adgl->num_card-1;
716 717
717 if(cmd != 6 && ((IndexCard >= MAX_BOARD) || !apbs[IndexCard].RamIO)) { 718 if(cmd != 6 && ((IndexCard >= MAX_BOARD) || !apbs[IndexCard].RamIO)) {
@@ -721,6 +722,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
721 warncount--; 722 warncount--;
722 } 723 }
723 kfree(adgl); 724 kfree(adgl);
725 unlock_kernel();
724 return -EINVAL; 726 return -EINVAL;
725 } 727 }
726 728
@@ -838,6 +840,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
838 } 840 }
839 Dummy = readb(apbs[IndexCard].RamIO + VERS); 841 Dummy = readb(apbs[IndexCard].RamIO + VERS);
840 kfree(adgl); 842 kfree(adgl);
843 unlock_kernel();
841 return 0; 844 return 0;
842} 845}
843 846