|
@@ -624,6 +624,12 @@ static ssize_t uio_write(struct file *filep, const char __user *buf,
|
|
|
ssize_t retval;
|
|
|
s32 irq_on;
|
|
|
|
|
|
+ if (count != sizeof(s32))
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
+ if (copy_from_user(&irq_on, buf, count))
|
|
|
+ return -EFAULT;
|
|
|
+
|
|
|
mutex_lock(&idev->info_lock);
|
|
|
if (!idev->info) {
|
|
|
retval = -EINVAL;
|
|
@@ -635,21 +641,11 @@ static ssize_t uio_write(struct file *filep, const char __user *buf,
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
- if (count != sizeof(s32)) {
|
|
|
- retval = -EINVAL;
|
|
|
- goto out;
|
|
|
- }
|
|
|
-
|
|
|
if (!idev->info->irqcontrol) {
|
|
|
retval = -ENOSYS;
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
- if (copy_from_user(&irq_on, buf, count)) {
|
|
|
- retval = -EFAULT;
|
|
|
- goto out;
|
|
|
- }
|
|
|
-
|
|
|
retval = idev->info->irqcontrol(idev->info, irq_on);
|
|
|
|
|
|
out:
|