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 <boris.brezillon@free-electrons.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
Boris Brezillon 2016-09-16 16:59:13 +02:00 committed by Richard Weinberger
parent ecbfa8eaba
commit 5f09aaa9b3

View file

@ -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;