Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;