commmon: fastboot: cast 64bit when converting sectors to bytes
authorChanho Park <chanho61.park@samsung.com>
Thu, 20 Aug 2015 04:30:33 +0000 (13:30 +0900)
committerChanho Park <parkch98@gmail.com>
Fri, 21 Aug 2015 01:45:02 +0000 (10:45 +0900)
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 <chanho61.park@samsung.com>
common/cmd_fastboot.c

index 4e6c1499003bdd5615571094a20ca98fe67636ea..5fd7e52eb0549aa1ec5e7f9adc8f55698530410b 100644 (file)
@@ -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;