neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-upf/+/32019 )


Change subject: unique_ids_test.c: fix coverity ASSERT_SIDE_EFFECT
......................................................................

unique_ids_test.c: fix coverity ASSERT_SIDE_EFFECT

Do the assignment separately, outside of the assert().

Related: CID#311450
Change-Id: I4490a62f444d5048779c9b184b5f580cecd4c149
---
M tests/unique_ids/unique_ids_test.c
1 file changed, 20 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/19/32019/1

diff --git a/tests/unique_ids/unique_ids_test.c 
b/tests/unique_ids/unique_ids_test.c
index 2120ab4..1a9b2b3 100644
--- a/tests/unique_ids/unique_ids_test.c
+++ b/tests/unique_ids/unique_ids_test.c
@@ -327,7 +327,8 @@
        dump_state();

        log_assert(s1->up_seid == 1);
-       log_assert(a = llist_first_entry_or_null(&s1->active_gtp_actions, 
struct up_gtp_action, entry));
+       a = llist_first_entry_or_null(&s1->active_gtp_actions, struct 
up_gtp_action, entry);
+       log_assert(a);
        log_assert(a->kind == UP_GTP_U_TUNMAP);
        log_assert(a->tunmap.core.tun.local.teid == 1);
        log_assert(a->tunmap.access.tun.local.teid == 2);
@@ -345,7 +346,8 @@
        dump_state();

        log_assert(s2->up_seid == 2);
-       log_assert(a = llist_first_entry_or_null(&s2->active_gtp_actions, 
struct up_gtp_action, entry));
+       a = llist_first_entry_or_null(&s2->active_gtp_actions, struct 
up_gtp_action, entry);
+       log_assert(a);
        log_assert(a->kind == UP_GTP_U_TUNMAP);
        log_assert(a->tunmap.core.tun.local.teid == 3);
        log_assert(a->tunmap.access.tun.local.teid == 4);
@@ -370,7 +372,8 @@
        dump_state();

        log_assert(s3->up_seid == 1);
-       log_assert(a = llist_first_entry_or_null(&s3->active_gtp_actions, 
struct up_gtp_action, entry));
+       a = llist_first_entry_or_null(&s3->active_gtp_actions, struct 
up_gtp_action, entry);
+       log_assert(a);
        log_assert(a->kind == UP_GTP_U_TUNMAP);
        log_assert(a->tunmap.core.tun.local.teid == 1);
        log_assert(a->tunmap.access.tun.local.teid == 2);
@@ -383,7 +386,8 @@
        dump_state();

        log_assert(s4->up_seid == 3);
-       log_assert(a = llist_first_entry_or_null(&s4->active_gtp_actions, 
struct up_gtp_action, entry));
+       a = llist_first_entry_or_null(&s4->active_gtp_actions, struct 
up_gtp_action, entry);
+       log_assert(a);
        log_assert(a->kind == UP_GTP_U_TUNMAP);
        log_assert(a->tunmap.core.tun.local.teid == 5);
        log_assert(a->tunmap.access.tun.local.teid == 6);

--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/32019
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I4490a62f444d5048779c9b184b5f580cecd4c149
Gerrit-Change-Number: 32019
Gerrit-PatchSet: 1
Gerrit-Owner: neels <[email protected]>
Gerrit-MessageType: newchange

Reply via email to