/* The ulong casting limits the maximum disk size to 2 TB */
info->start = (ulong) le64_to_int((*pgpt_pte)[part - 1].starting_lba);
- info->size = (ulong) le64_to_int((*pgpt_pte)[part - 1].ending_lba) - info->start;
+ /* The ending LBA is inclusive, to calculate size, add 1 to it */
+ info->size = ((ulong)le64_to_int((*pgpt_pte)[part - 1].ending_lba) + 1)
+ - info->start;
info->blksz = GPT_BLOCK_SIZE;
sprintf((char *)info->name, "%s%d\n", GPT_ENTRY_NAME, part);