]> git.dujemihanovic.xyz Git - u-boot.git/commit
lib: sparse: Fix error checking for write_sparse_chunk_raw
authorSean Anderson <sean.anderson@seco.com>
Thu, 1 Feb 2024 18:18:51 +0000 (13:18 -0500)
committerMattijs Korpershoek <mkorpershoek@baylibre.com>
Fri, 9 Feb 2024 08:42:04 +0000 (09:42 +0100)
commit766f04a297e892d5106f7f7ac8b43c69bd8a6007
tree73d5e952238ff593eb312a226aa09a6ed2afc404
parentec19e113738ef6d689a43bff5f1ffc0e29def957
lib: sparse: Fix error checking for write_sparse_chunk_raw

The return value of write_sparse_chunk_raw is unsigned, so the existing
check has no effect. Use IS_ERR_VALUE to detect error instead, which is
what write_sparse_chunk_raw does itself.

Fixes: 62649165cb0 ("lib: sparse: Make CHUNK_TYPE_RAW buffer aligned")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/u-boot/1b323ec3-59b0-490b-a2f0-fd961dafcf49@moroto.mountain/
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20240201181851.221701-1-sean.anderson@seco.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
lib/image-sparse.c