From b15553c6577c2b2756b1fc16a0d869c22e8fa054 Mon Sep 17 00:00:00 2001 From: Chanho Park Date: Thu, 20 Aug 2015 13:30:33 +0900 Subject: [PATCH] commmon: fastboot: cast 64bit when converting sectors to bytes This patch fixes a cast error when converting sectors to bytes. The start and size types of the disk_partition_t are 32bit until the SYS_64BIT_LBA is defined. To prevent the converting error, we should cast the value to 64bit values. Change-Id: Ibc71207642aba2d78091123f311b8a30f33e78c7 Signed-off-by: Chanho Park --- common/cmd_fastboot.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c index 4e6c14990..5fd7e52eb 100644 --- a/common/cmd_fastboot.c +++ b/common/cmd_fastboot.c @@ -1774,8 +1774,10 @@ static int get_mmc_partition_tables() break; strcpy(ptable[pcount].name, info.name); - ptable[pcount].start = info.start * info.blksz; - ptable[pcount].length = info.size * info.blksz; + ptable[pcount].start = (unsigned long long)info.start * + info.blksz; + ptable[pcount].length = (unsigned long long)info.size * + info.blksz; ptable[pcount].flags = FASTBOOT_PTENTRY_FLAGS_USE_MMC_CMD; #ifdef CONFIG_FASTBOOT_FLASH_CHUNK ptable[pcount].flags |= FASTBOOT_PTENTRY_FLAGS_FLASH_CHUNK; -- 2.34.1