Commit 5f09aaa9 authored by Boris Brezillon's avatar Boris Brezillon Committed by Richard Weinberger

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: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent ecbfa8ea
...@@ -416,7 +416,7 @@ static long vol_cdev_ioctl(struct file *file, unsigned int cmd, ...@@ -416,7 +416,7 @@ static long vol_cdev_ioctl(struct file *file, unsigned int cmd,
} }
rsvd_bytes = (long long)vol->reserved_pebs * rsvd_bytes = (long long)vol->reserved_pebs *
ubi->leb_size-vol->data_pad; vol->usable_leb_size;
if (bytes < 0 || bytes > rsvd_bytes) { if (bytes < 0 || bytes > rsvd_bytes) {
err = -EINVAL; err = -EINVAL;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment