[PATCH] mtd: mtdpart: use uint64_t instead of int for cur_off

Tom Rini trini at konsulko.com
Fri Jul 17 22:58:56 CEST 2020


On Mon, Jul 13, 2020 at 02:40:02PM +0200, Martin Kaistra wrote:

> 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 at linutronix.de>
> Reviewed-by: Kurt Kanzenbach <kurt at linutronix.de>
> Reviewed-by: Heiko Schocher <hs at denx.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200717/7636120c/attachment.sig>


More information about the U-Boot mailing list