diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2020-04-23 04:52:07 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-05-29 17:04:56 +0200 |
commit | 5f599098f7608deb4fa063486452f8f1dfd8a72c (patch) | |
tree | 1d106d0718b7b4024209918dcdb1556587d78b9b /drivers/char | |
parent | nvram: drop useless access_ok() (diff) | |
download | linux-5f599098f7608deb4fa063486452f8f1dfd8a72c.tar.xz linux-5f599098f7608deb4fa063486452f8f1dfd8a72c.zip |
cm4000_cs.c cmm_ioctl(): get rid of pointless access_ok()
copy_to_user()/copy_from_user() for everything
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/pcmcia/cm4000_cs.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index 4edb4174a1e2..89681f07bc78 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c @@ -1404,7 +1404,6 @@ static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) unsigned int iobase = dev->p_dev->resource[0]->start; struct inode *inode = file_inode(filp); struct pcmcia_device *link; - int size; int rc; void __user *argp = (void __user *)arg; #ifdef CM4000_DEBUG @@ -1441,19 +1440,6 @@ static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) DEBUGP(4, dev, "iocnr mismatch\n"); goto out; } - size = _IOC_SIZE(cmd); - rc = -EFAULT; - DEBUGP(4, dev, "iocdir=%.4x iocr=%.4x iocw=%.4x iocsize=%d cmd=%.4x\n", - _IOC_DIR(cmd), _IOC_READ, _IOC_WRITE, size, cmd); - - if (_IOC_DIR(cmd) & _IOC_READ) { - if (!access_ok(argp, size)) - goto out; - } - if (_IOC_DIR(cmd) & _IOC_WRITE) { - if (!access_ok(argp, size)) - goto out; - } rc = 0; switch (cmd) { |