]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - block/ioctl.c
bcm2835-camera: Correct port_parameter_get return value
[mirror_ubuntu-zesty-kernel.git] / block / ioctl.c
index f856963204f4949f5197c1cb0c0a247ca12c95da..be7f4de3eb3cfe7edc7a95644b2d9ee350703b88 100644 (file)
@@ -8,7 +8,7 @@
 #include <linux/fs.h>
 #include <linux/blktrace_api.h>
 #include <linux/pr.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 
 static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user *arg)
 {
@@ -45,6 +45,9 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
                                    || pstart < 0 || plength < 0 || partno > 65535)
                                        return -EINVAL;
                        }
+                       /* check if partition is aligned to blocksize */
+                       if (p.start & (bdev_logical_block_size(bdev) - 1))
+                               return -EINVAL;
 
                        mutex_lock(&bdev->bd_mutex);