Skip to content

Commit

Permalink
UBI: fix 64-bit calculations
Browse files Browse the repository at this point in the history
Signed-off-by: Bruce Leonard <brucle@selinc.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
  • Loading branch information
Bruce Leonard authored and Artem Bityutskiy committed Jul 24, 2008
1 parent 23add74 commit 73789a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mtd/ubi/cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ static int vol_cdev_ioctl(struct inode *inode, struct file *file,
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) {
err = -EINVAL;
break;
Expand Down

0 comments on commit 73789a3

Please sign in to comment.