From: Bruce Leonard Date: Thu, 3 Jul 2008 07:35:49 +0000 (+0300) Subject: UBI: fix 64-bit calculations X-Git-Tag: v2.6.27-rc1~223^2~13 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=73789a3d9fd8e500e121c1d4a5a2b16dd748ab5f;p=linux-2.6-omap-h63xx.git UBI: fix 64-bit calculations Signed-off-by: Bruce Leonard Signed-off-by: Artem Bityutskiy --- diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index 0cdaf9fba7b..3e3449ec07f 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c @@ -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;