Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73789a3d authored by Bruce Leonard's avatar Bruce Leonard Committed by Artem Bityutskiy
Browse files

UBI: fix 64-bit calculations

parent 23add745
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;