diff mbox series

[ovs-dev,2/2] northd: Remove unnecessary pointer checks.

Message ID 20241105110911.280756-3-amusil@redhat.com
State New
Headers show
Series Minor fixes pointed out 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 Nov. 5, 2024, 11:09 a.m. UTC
The pointers in those checks are guaranteed to be non-NULL at that
point in the code. There is no need to check them as pointed out
by coverity.

Signed-off-by: Ales Musil <amusil@redhat.com>
---
 northd/northd.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/northd/northd.c b/northd/northd.c
index 3037ce0b5..6087d170d 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -2397,7 +2397,7 @@  join_logical_ports(const struct sbrec_port_binding_table *sbrec_pb_table,
             /* If the router is multicast enabled then set relay on the switch
              * datapath.
              */
-            if (peer->od && peer->od->mcast_info.rtr.relay) {
+            if (peer->od->mcast_info.rtr.relay) {
                 op->od->mcast_info.sw.flood_relay = true;
             }
 
@@ -3523,7 +3523,7 @@  ovn_lb_svc_create(struct ovsdb_idl_txn *ovnsb_txn,
             }
 
             const char *chassis_name = NULL;
-            if (op->sb && op->sb->chassis) {
+            if (op->sb->chassis) {
                 chassis_name = op->sb->chassis->name;
             }
 
@@ -9910,8 +9910,7 @@  build_lswitch_dhcp_options_and_response(struct ovn_port *op,
         return;
     }
 
-    if (op->od && op->od->nbs
-        && ls_dhcp_relay_port(op->od)) {
+    if (ls_dhcp_relay_port(op->od)) {
         /* Don't add the DHCP server flows if DHCP Relay is enabled on the
          * logical switch. */
         return;