diff mbox series

[ovs-dev,4/4] treewide: Prevent potential NULL ptr deref.

Message ID 20240626133007.694177-5-amusil@redhat.com
State Accepted
Headers show
Series Fix issues reported by coverity | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Ales Musil June 26, 2024, 1:30 p.m. UTC
Prevent potential NULL ptr deref that might have happened in corner
case.

Signed-off-by: Ales Musil <amusil@redhat.com>
---
 northd/northd.c          | 2 +-
 utilities/ovn-ic-nbctl.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/northd/northd.c b/northd/northd.c
index 7e474a7b8..b4d8e069b 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -16180,8 +16180,8 @@  build_lflows_thread(void *arg)
                                                     &lsi->actions);
                 }
             }
+            lsi->thread_lflow_counter = thread_lflow_counter;
         }
-        lsi->thread_lflow_counter = thread_lflow_counter;
         post_completed_work(control);
     }
     return NULL;
diff --git a/utilities/ovn-ic-nbctl.c b/utilities/ovn-ic-nbctl.c
index 4317c385a..77a69df0b 100644
--- a/utilities/ovn-ic-nbctl.c
+++ b/utilities/ovn-ic-nbctl.c
@@ -821,7 +821,7 @@  do_ic_nbctl(const char *args, struct ctl_command *commands, size_t n_commands,
     const struct icnbrec_ic_nb_global *inb = icnbrec_ic_nb_global_first(idl);
     if (!inb) {
         /* XXX add verification that table is empty */
-        icnbrec_ic_nb_global_insert(txn);
+       inb = icnbrec_ic_nb_global_insert(txn);
     }
 
     if (wait_type != NBCTL_WAIT_NONE) {