lib: trusty: Assert that at most one handle gets deleted am: 3268d1221e Original change: https://android-review.googlesource.com/c/trusty/lk/trusty/+/3529080 Change-Id: Ieee2cd39634a23755d9c90bf3940772f2d25c636 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/lib/trusty/uctx.c b/lib/trusty/uctx.c index b3a775f..abd6ed1 100644 --- a/lib/trusty/uctx.c +++ b/lib/trusty/uctx.c
@@ -732,6 +732,7 @@ free(ref); } } + ASSERT(del_cnt <= 1); return del_cnt ? NO_ERROR : ERR_NOT_FOUND; } @@ -751,6 +752,7 @@ handle_set_update_ref(ref, emask, cookie); } } + ASSERT(mod_cnt <= 1); return mod_cnt ? NO_ERROR : ERR_NOT_FOUND; }