summaryrefslogtreecommitdiff
path: root/lib/image-sparse.c
diff options
context:
space:
mode:
authorSean Anderson <[email protected]>2024-02-01 13:18:51 -0500
committerMattijs Korpershoek <[email protected]>2024-02-09 09:42:04 +0100
commit766f04a297e892d5106f7f7ac8b43c69bd8a6007 (patch)
tree73d5e952238ff593eb312a226aa09a6ed2afc404 /lib/image-sparse.c
parentec19e113738ef6d689a43bff5f1ffc0e29def957 (diff)
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 <[email protected]> Link: https://lore.kernel.org/u-boot/[email protected]/ Signed-off-by: Sean Anderson <[email protected]> Reviewed-by: Michael Trimarchi <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mattijs Korpershoek <[email protected]>
Diffstat (limited to 'lib/image-sparse.c')
-rw-r--r--lib/image-sparse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/image-sparse.c b/lib/image-sparse.c
index f8289064692..09225692e9b 100644
--- a/lib/image-sparse.c
+++ b/lib/image-sparse.c
@@ -211,7 +211,7 @@ int write_sparse_image(struct sparse_storage *info,
blks = write_sparse_chunk_raw(info, blk, blkcnt,
data, response);
- if (blks < 0)
+ if (IS_ERR_VALUE(blks))
return -1;
blk += blks;