From: Boris Brezillon Date: Fri, 16 Sep 2016 14:59:13 +0000 (+0200) Subject: UBI: use vol->usable_leb_size instead of (ubi->leb_size - vol->data_pad) X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5f09aaa9b30c91e6f72790bfb975240e8116d6db;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git UBI: use vol->usable_leb_size instead of (ubi->leb_size - vol->data_pad) vol->usable_size is already set to ubi->leb_size - vol->data_pad. Use vol->usable_size instead of recalculating it. Signed-off-by: Boris Brezillon Signed-off-by: Richard Weinberger --- diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index ee2b74d1d1b5..3490dcd99ad1 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c @@ -416,7 +416,7 @@ static long vol_cdev_ioctl(struct file *file, unsigned int cmd, } rsvd_bytes = (long long)vol->reserved_pebs * - ubi->leb_size-vol->data_pad; + vol->usable_leb_size; if (bytes < 0 || bytes > rsvd_bytes) { err = -EINVAL; break;