The types of "offset" and "size" of "struct mtd_partition" are uint64_t,
while mtd_parse_partitions() uses int to work with these values. When
the offset reaches 2GB, it is interpreted as a negative value, which
leads to error messages like
mtd: partition "<partition name>" is out of reach -- disabled
eg. when using the "ubi part" command.
Fix this by using uint64_t for cur_off and cur_sz.
Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>
Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
{
struct mtd_partition partition = {}, *parts;
const char *mtdparts = *_mtdparts;
- int cur_off = 0, cur_sz = 0;
+ uint64_t cur_off = 0, cur_sz = 0;
int nparts = 0;
int ret, idx;
u64 sz;