Revert "Check integer overflow in do_insnlist_ioctl()"
authorIan Abbott <abbotti@mev.co.uk>
Wed, 23 Nov 2011 14:43:03 +0000 (14:43 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Wed, 23 Nov 2011 14:43:03 +0000 (14:43 +0000)
Xi Wang pointed out a flaw in the current check.

comedi/comedi_fops.c

index e46c7c4bac097f86930d78869d53c10cd9eb79e3..4d3a5dd1d503213e181d20bad0b1f3fe6394886d 100644 (file)
@@ -701,12 +701,6 @@ static int do_insnlist_ioctl(comedi_device * dev, void *arg, void *file)
                goto error;
        }
 
-       if (sizeof(comedi_insn) * insnlist.n_insns < insnlist.n_insns) {
-               DPRINTK("number of instructions too large\n");
-               ret = -EINVAL;
-               goto error;
-       }
-
        insns = kmalloc(sizeof(comedi_insn) * insnlist.n_insns, GFP_KERNEL);
        if (!insns) {
                DPRINTK("kmalloc failed\n");