]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/ubi/cdev.c
UBI: fix 64-bit calculations
[linux-2.6-omap-h63xx.git] / drivers / mtd / ubi / cdev.c
index 0cdaf9fba7b09160095119c2de729f143e8979ef..3e3449ec07f0c6874fe943c55b7c761864b0be41 100644 (file)
@@ -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;