From 37e8e0baa77634665c1742cb0c9ac97f7b496694 Mon Sep 17 00:00:00 2001 From: Sergey Oblomov Date: Tue, 30 Jan 2018 20:51:32 +0200 Subject: [PATCH] UCP/ARBITRATOR: better asserts - minor asserts refactoring to improve error handling --- src/ucs/datastruct/arbiter.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ucs/datastruct/arbiter.c b/src/ucs/datastruct/arbiter.c index bf97becd9e8..092af593cff 100644 --- a/src/ucs/datastruct/arbiter.c +++ b/src/ucs/datastruct/arbiter.c @@ -136,8 +136,11 @@ void ucs_arbiter_dispatch_nonempty(ucs_arbiter_t *arbiter, unsigned per_group, do { group_head = next_group; + ucs_assert(group_head != NULL); prev_group = ucs_list_prev(&group_head->list, ucs_arbiter_elem_t, list); next_group = ucs_list_next(&group_head->list, ucs_arbiter_elem_t, list); + ucs_assert(prev_group != NULL); + ucs_assert(next_group != NULL); ucs_assert(prev_group->list.next == &group_head->list); ucs_assert(next_group->list.prev == &group_head->list);