Skip to content

Commit

Permalink
UBI: use vol->usable_leb_size instead of (ubi->leb_size - vol->data_pad)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Boris Brezillon authored and Richard Weinberger committed Oct 2, 2016
1 parent ecbfa8e commit 5f09aaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/ubi/cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5f09aaa

Please sign in to comment.