misc: xilinx-sdfec: remove check for ioctl cmd and argument.
authorHarshal Chaudhari <harshalchau04@gmail.com>
Sun, 1 Nov 2020 17:09:49 +0000 (22:39 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Nov 2020 09:11:48 +0000 (10:11 +0100)
commitc78c95f919539cad0308e7de0d5d0d656e4a8e98
treefd295f2663d0a6ee12421e8216cfc7f12df97df6
parent33fcc5491897504856783335102142676dbee817
misc: xilinx-sdfec: remove check for ioctl cmd and argument.

if (_IOC_TYPE(cmd) != PP_IOCTL)
        return -ENOTTY;

Invalid ioctl command check normally performs by “default” case.

if (_IOC_DIR(cmd) != _IOC_NONE) {
       argp = (void __user *)arg;
       if (!argp)
             return -EINVAL; }

And for checking ioctl arguments, copy_from_user()/copy_to_user()
checks are enough.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Harshal Chaudhari <harshalchau04@gmail.com>
Link: https://lore.kernel.org/r/20201101170949.18616-1-harshalchau04@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/xilinx_sdfec.c