]> git.ipfire.org Git - thirdparty/u-boot.git/commit
env: sf: report malloc error to caller
authorRalph Siemsen <ralph.siemsen@linaro.org>
Fri, 19 Jan 2024 21:32:17 +0000 (16:32 -0500)
committerTom Rini <trini@konsulko.com>
Mon, 29 Jan 2024 19:52:23 +0000 (14:52 -0500)
commit04add62e8cf1209ca21ddfa13346d9ddcc6126fb
tree0c6e1b2f7bd75ae387275da452d549be107a93dd
parentca6d60df2f3616f1817951621aa46023737ec711
env: sf: report malloc error to caller

In the non-redundant code for env_sf_save(), a failure to malloc() the
temporary buffer produces the following output:

    Saving Environment to SPIFlash... OK

This is misleading as the flash has neither been erased nor written.

Fix it to return an error to the caller, so the output will be:

    Saving Environment to SPIFlash... Failed (-12)

Note that there is another copy of env_sf_save() in the same file, for
handling redundant environment, and it already has the same logic.

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
env/sf.c