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:
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user