diff options
Diffstat (limited to 'drivers/mtd/ubi/vmt.c')
-rw-r--r-- | drivers/mtd/ubi/vmt.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c index d62dac90e108..ea0d5c825ab4 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c | |||
@@ -280,7 +280,8 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req) | |||
280 | if (vol->vol_type == UBI_DYNAMIC_VOLUME) { | 280 | if (vol->vol_type == UBI_DYNAMIC_VOLUME) { |
281 | vol->used_ebs = vol->reserved_pebs; | 281 | vol->used_ebs = vol->reserved_pebs; |
282 | vol->last_eb_bytes = vol->usable_leb_size; | 282 | vol->last_eb_bytes = vol->usable_leb_size; |
283 | vol->used_bytes = vol->used_ebs * vol->usable_leb_size; | 283 | vol->used_bytes = |
284 | (long long)vol->used_ebs * vol->usable_leb_size; | ||
284 | } else { | 285 | } else { |
285 | bytes = vol->used_bytes; | 286 | bytes = vol->used_bytes; |
286 | vol->last_eb_bytes = do_div(bytes, vol->usable_leb_size); | 287 | vol->last_eb_bytes = do_div(bytes, vol->usable_leb_size); |
@@ -538,7 +539,8 @@ int ubi_resize_volume(struct ubi_volume_desc *desc, int reserved_pebs) | |||
538 | if (vol->vol_type == UBI_DYNAMIC_VOLUME) { | 539 | if (vol->vol_type == UBI_DYNAMIC_VOLUME) { |
539 | vol->used_ebs = reserved_pebs; | 540 | vol->used_ebs = reserved_pebs; |
540 | vol->last_eb_bytes = vol->usable_leb_size; | 541 | vol->last_eb_bytes = vol->usable_leb_size; |
541 | vol->used_bytes = vol->used_ebs * vol->usable_leb_size; | 542 | vol->used_bytes = |
543 | (long long)vol->used_ebs * vol->usable_leb_size; | ||
542 | } | 544 | } |
543 | 545 | ||
544 | paranoid_check_volumes(ubi); | 546 | paranoid_check_volumes(ubi); |
@@ -739,7 +741,7 @@ static void paranoid_check_volume(struct ubi_device *ubi, int vol_id) | |||
739 | goto fail; | 741 | goto fail; |
740 | } | 742 | } |
741 | 743 | ||
742 | n = vol->used_ebs * vol->usable_leb_size; | 744 | n = (long long)vol->used_ebs * vol->usable_leb_size; |
743 | if (vol->vol_type == UBI_DYNAMIC_VOLUME) { | 745 | if (vol->vol_type == UBI_DYNAMIC_VOLUME) { |
744 | if (vol->corrupted != 0) { | 746 | if (vol->corrupted != 0) { |
745 | ubi_err("corrupted dynamic volume"); | 747 | ubi_err("corrupted dynamic volume"); |