Fix rounding up of buffer size to integer multiple of page size.
authorFrank Mori Hess <fmhess@speakeasy.net>
Tue, 15 Aug 2006 18:58:02 +0000 (18:58 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Tue, 15 Aug 2006 18:58:02 +0000 (18:58 +0000)
comedi/comedi_fops.c

index 33afcebd2e4222cddaa65acf5824a27e34094b31..1677cbc3676fb7a23c7615aa0d2a70a498ba4438 100644 (file)
@@ -258,7 +258,7 @@ static int do_bufconfig_ioctl(comedi_device *dev,void *arg)
 
                /* make sure buffer is an integral number of pages
                 * (we round up) */
-               bc.size = (bc.size + 1)&PAGE_MASK;
+               bc.size = (bc.size + PAGE_SIZE - 1) & PAGE_MASK;
 
                ret = comedi_buf_alloc(dev, s, bc.size);
                if(ret < 0) return ret;