UBI: fix 64-bit calculations

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Jul 25 10:59:03 EDT 2008


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=73789a3d9fd8e500e121c1d4a5a2b16dd748ab5f
Commit:     73789a3d9fd8e500e121c1d4a5a2b16dd748ab5f
Parent:     23add7455c42eef63f8719bd268328047d4aed69
Author:     Bruce Leonard <brucle at selinc.com>
AuthorDate: Thu Jul 3 10:35:49 2008 +0300
Committer:  Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
CommitDate: Thu Jul 24 13:32:56 2008 +0300

    UBI: fix 64-bit calculations
    
    Signed-off-by: Bruce Leonard <brucle at selinc.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
---
 drivers/mtd/ubi/cdev.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index 0cdaf9f..3e3449e 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;



More information about the linux-mtd-cvs mailing list