diff mbox series

[ovs-dev,V2,7/8] ofproto: Fix 'reply.type' may be used uninitialized

Message ID 20221116104727.915151-8-elibr@nvidia.com
State Deferred
Headers show
Series Fix warnings and enable Werror | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Eli Britstein Nov. 16, 2022, 10:47 a.m. UTC
../ofproto/ofproto.c: In function 'handle_openflow':
../lib/ofp-bundle.c:195:15: error: 'reply.type' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  195 |     m->type = htons(msg->type);
      |               ^
../ofproto/ofproto.c:8460:36: note: 'reply.type' was declared here
 8460 |     struct ofputil_bundle_ctrl_msg reply;
      |                                    ^

Fixes: 777af88d50b8 ("Add basic implementation for OpenFlow 1.4 bundles")
Signed-off-by: Eli Britstein <elibr@nvidia.com>
---
 ofproto/ofproto.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 3a527683c..5ba1b55fb 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -8471,6 +8471,7 @@  handle_bundle_control(struct ofconn *ofconn, const struct ofp_header *oh)
         return error;
     }
     reply.flags = 0;
+    reply.type = 0;
     reply.bundle_id = bctrl.bundle_id;
 
     switch (bctrl.type) {