UBI: fix 64-bit calculations

Signed-off-by: Bruce Leonard <brucle@selinc.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:
Bruce Leonard 2008-07-03 10:35:49 +03:00 committed by Artem Bityutskiy
parent 23add7455c
commit 73789a3d9f
1 changed files with 2 additions and 1 deletions

View File

@ -437,7 +437,8 @@ static int vol_cdev_ioctl(struct inode *inode, struct file *file,
break; break;
} }
rsvd_bytes = vol->reserved_pebs * (ubi->leb_size-vol->data_pad); rsvd_bytes = (long long)vol->reserved_pebs *
ubi->leb_size-vol->data_pad;
if (bytes < 0 || bytes > rsvd_bytes) { if (bytes < 0 || bytes > rsvd_bytes) {
err = -EINVAL; err = -EINVAL;
break; break;