]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
fdt: check fdt_pack() return value in fdtdec_apply_bloblist_dtos()
authorMichal Simek <michal.simek@amd.com>
Wed, 29 Apr 2026 06:22:08 +0000 (08:22 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 4 May 2026 18:56:08 +0000 (12:56 -0600)
The fdt_pack() function can return an error code, but its return value
was not being checked. Add proper error handling to propagate any
failure.

Also fix typo in comment: "Shink" -> "Shrink".

Addresses-Coverity-ID: CID 645839: Error handling issues (CHECKED_RETURN)
Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Raymond Mao <raymondmaoca@gmail.com>
lib/fdtdec.c

index c6e13b6abefdb43e99d28ae77583a84a1e18b651..2d66860f6ed05482f36a26b2fa694de3793e6902 100644 (file)
@@ -1781,8 +1781,11 @@ static int fdtdec_apply_bloblist_dtos(void)
        if (ret)
                return ret;
 
-       /* Shink the blob to the actual FDT size */
-       fdt_pack(live_fdt);
+       /* Shrink the blob to the actual FDT size */
+       ret = fdt_pack(live_fdt);
+       if (ret)
+               return ret;
+
        return bloblist_resize(BLOBLISTT_CONTROL_FDT, fdt_totalsize(live_fdt));
 }