Commit ce3ffc23 authored by yidong0635's avatar yidong0635 Committed by Ben Walker
Browse files

blobstore: Add assert in blob_id_cmp.



From the issue report in #2507
that comparing blob maybe be NULL.
So add assert, that in CI may catch this issue.
And other funtions add this also.

Signed-off-by: default avataryidong0635 <dongx.yi@intel.com>
Change-Id: I98179ec76f2b6785b6921c37373204021c0669b6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12737


Reviewed-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent cb9e0db8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ blob_is_esnap_clone(const struct spdk_blob *blob)
static int
blob_id_cmp(struct spdk_blob *blob1, struct spdk_blob *blob2)
{
	assert(blob1 != NULL && blob2 != NULL);
	return (blob1->id < blob2->id ? -1 : blob1->id > blob2->id);
}