Fix used-before-set in vl_api_bridge_flags_t_handler 80/16680/1
authorDave Barach <dave@barachs.net>
Thu, 3 Jan 2019 14:30:00 +0000 (09:30 -0500)
committerDave Barach <dave@barachs.net>
Thu, 3 Jan 2019 14:51:42 +0000 (09:51 -0500)
The aarch64 cross-compiler complains about this when building an
optimized image. So we fix it...

Change-Id: Ib2b2089c0534753d7d470311012fa0073ab27d1d
Signed-off-by: Dave Barach <dave@barachs.net>
src/vnet/l2/l2_api.c

index 9e3a47f..25f38a6 100644 (file)
@@ -558,6 +558,7 @@ vl_api_bridge_flags_t_handler (vl_api_bridge_flags_t * mp)
   vlib_main_t *vm = vlib_get_main ();
   bd_main_t *bdm = &bd_main;
   vl_api_bridge_flags_reply_t *rmp;
+  u32 bitmap = 0;
   int rv = 0;
 
   bd_flags_t flags = bd_flags_decode (mp->flags);
@@ -575,7 +576,7 @@ vl_api_bridge_flags_t_handler (vl_api_bridge_flags_t * mp)
       goto out;
     }
 
-  u32 bitmap = bd_set_flags (vm, bd_index, flags, mp->is_set);
+  bitmap = bd_set_flags (vm, bd_index, flags, mp->is_set);
 
 out:
   /* *INDENT-OFF* */