fix integer promotion bug in partition size check

The check '(user_data_end - partition < partition_size)' must be
evaluated as a signed comparison, but because partition_size was
unsigned, the LHS was promoted to unsigned, causing an incorrect
result on 32-bit. Instead, check the upper and lower bounds of
the segment separately.

Change-Id: Ia01708be8492e64abb16b8157e816bd59e2472cf
2 files changed