aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/applicom.c
diff options
context:
space:
mode:
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