Commit 8d000095 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Attempt to silence coverity warning

Coverity fails to see that with at least 2 OC refs on entry to EXP_Insert,
and one deref if race, then at least one ref remains. Attempt to coerce
acception.
parent 56a5b3bd
......@@ -177,6 +177,7 @@ void
EXP_Insert(struct worker *wrk, struct objcore *oc)
{
unsigned remove_race = 0;
struct objcore *tmpoc;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
......@@ -186,6 +187,8 @@ EXP_Insert(struct worker *wrk, struct objcore *oc)
if (!(oc->exp_flags & OC_EF_REFD))
return;
/* One ref held by the caller, and one that wil be owned by
* expiry. */
assert(oc->refcnt >= 2);
ObjSendEvent(wrk, oc, OEV_INSERT);
......@@ -204,8 +207,10 @@ EXP_Insert(struct worker *wrk, struct objcore *oc)
if (remove_race) {
ObjSendEvent(wrk, oc, OEV_EXPIRE);
(void)HSH_DerefObjCore(wrk, &oc, 0);
AZ(oc);
tmpoc = oc;
(void)HSH_DerefObjCore(wrk, &tmpoc, 0);
AZ(tmpoc);
assert(oc->refcnt >= 1); /* Silence coverity */
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment