[PATCH v2] fastboot: Fix has-slot command always returning yes for fb_nand
Mattijs Korpershoek
mkorpershoek at kernel.org
Tue Sep 30 11:49:49 CEST 2025
Hi,
On Tue, 26 Aug 2025 11:36:17 +0800, Chance Yang wrote:
> The issue was a mismatch in return value conventions between functions:
> - getvar_get_part_info() expects >= 0 for success
> - fb_nand_lookup() returns 0 on success, 1 on failure (from
> mtdparts_init and find_dev_and_part)
>
> When partition didn't exist, fb_nand_lookup returned 1, but
> fastboot_nand_get_part_info passed it directly to getvar_get_part_info,
> which treated 1 >= 0 as success, causing has-slot to always return yes.
>
> [...]
Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-dfu (u-boot-dfu-next)
[1/1] fastboot: Fix has-slot command always returning yes for fb_nand
https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/3ce8a0e9115eaa0cdfc142459814b2283cf01785
--
Mattijs
More information about the U-Boot
mailing list