Message ID | 20241105110911.280756-2-amusil@redhat.com |
---|---|
State | New |
Headers | show |
Series | Minor fixes pointed out by coverity | expand |
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 | fail | github build: failed |
diff --git a/controller/mirror.c b/controller/mirror.c index ebe455968..b557b96da 100644 --- a/controller/mirror.c +++ b/controller/mirror.c @@ -352,7 +352,8 @@ sync_ovn_mirror(struct ovn_mirror *m, struct ovsdb_idl_txn *ovs_idl_txn, return; } - if (m->sb_mirror && !m->ovs_mirror) { + ovs_assert(m->sb_mirror); + if (!m->ovs_mirror) { create_ovs_mirror(m, ovs_idl_txn, br_int, ovs_mirror_ports); if (!m->ovs_mirror) { return; @@ -390,7 +391,7 @@ should_delete_ovs_mirror(struct ovn_mirror *m) return false; } - if (m->ovs_mirror && !m->sb_mirror) { + if (!m->sb_mirror) { return true; }
As pointed out by coverity, the code was structured in a way that m->sb_mirror might have been NULL. At that point in the code it's not possible. Add assert to emphasize that and remove redundant check for m->ovs_mirror. Signed-off-by: Ales Musil <amusil@redhat.com> --- controller/mirror.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)