diff --git a/fs/partition/fs_gpt.c b/fs/partition/fs_gpt.c index df639cc172..90c9ee8dd0 100644 --- a/fs/partition/fs_gpt.c +++ b/fs/partition/fs_gpt.c @@ -173,8 +173,8 @@ static const struct gpt_guid_s g_null_guid; static inline blkcnt_t gpt_last_lba(FAR struct partition_state_s *state) { - return (state->nblocks * state->blocksize + GPT_BLOCK_SIZE - 1) / - GPT_BLOCK_SIZE - 1; + return (((uint64_t)state->nblocks) * state->blocksize + GPT_BLOCK_SIZE - 1) + / GPT_BLOCK_SIZE - 1; } /****************************************************************************