Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 361 → Rev 362

/pcivme-3.2/driver/fops.c
67,11 → 67,7
 
#include <linux/sched.h>
#include <linux/fs.h>
#if HAVE_UNLOCKED_IOCTL
#include <linux/mutex.h>
#else
#include <linux/smp_lock.h>
#endif
#include <linux/mutex.h>
 
 
#include "fops.h"
730,9 → 726,9
 
// check for accessible user buffer
if (_IOC_DIR(cmd) & _IOC_READ)
err = !access_ok(VERIFY_WRITE, (void *)arg, _IOC_SIZE(cmd));
err = !access_ok( (void *)arg, _IOC_SIZE(cmd));
if (_IOC_DIR(cmd) & _IOC_WRITE)
err = !access_ok(VERIFY_READ, (void *)arg, _IOC_SIZE(cmd));
err = !access_ok( (void *)arg, _IOC_SIZE(cmd));
if (err)
return -EFAULT;
 
812,22 → 808,14
long retval=0;
 
 
#if HAVE_UNLOCKED_IOCTL
struct mutex fs_mutex;
mutex_init(&fs_mutex);
mutex_lock(&fs_mutex);
#else
lock_kernel();
#endif
 
PRINTK(KERN_DEBUG "%s : pcivme_unlocked_ioctl(0x%08x), size = %d\n", DEVICE_NAME, cmd, _IOC_SIZE(cmd));
retval = pcivme_ioctl(NULL, pFile, cmd,arg);
 
#if HAVE_UNLOCKED_IOCTL
mutex_unlock(&fs_mutex);
#else
unlock_kernel();
#endif
 
return retval;
}
957,7 → 945,7
return -EFAULT;
 
// check for free access to user buffer
if (!access_ok(VERIFY_WRITE, pcBuffer, count))
if (!access_ok( pcBuffer, count))
return -EFAULT;
 
// do I still have the same modifier?
999,7 → 987,7
return -EFAULT;
 
// check for free access to user buffer
if (!access_ok(VERIFY_READ, pcBuffer, count))
if (!access_ok( pcBuffer, count))
return -EFAULT;
 
// do I still have the same modifier?