bloblist: fix pointer comparison in bloblist_apply_blobs()

The rec_from_blob() function returns a pointer, but the code was
comparing it using "rec <= 0" which is incorrect for pointer types.
Pointers should be compared using "== NULL" or "!= NULL".

Addresses-Coverity-ID: CID 645841: Incorrect expression (BAD_COMPARE)
Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Raymond Mao <raymondmaoca@gmail.com>
This commit is contained in:
Michal Simek
2026-04-29 08:29:53 +02:00
committed by Tom Rini
parent 7dd93524ea
commit 0fd32094c0

View File

@@ -300,7 +300,7 @@ int bloblist_apply_blobs(uint tag, int (*func)(void **data, int size))
}
rec = rec_from_blob(blob - dat_off);
if (rec <= 0) {
if (!rec) {
log_err("Blob corrupted\n");
return -ENOENT;
}