aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2024-10-07 21:53:04 +0000
committerBeno�t Ganne <bganne@cisco.com>2024-10-08 10:06:47 +0000
commitad6aacc44adce5971f9d679a81d77b6618ba00ba (patch)
tree20d35853d81743ded63a61593720ef87754531b4 /src
parent4856f33fa81b5a0cc3de6f0bc26b27235bc8270c (diff)
pg: fix the coverity warning
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ida88c304f110b05051211ce243fd04ce811a9d4d
Diffstat (limited to 'src')
-rw-r--r--src/vnet/pg/pg_api.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vnet/pg/pg_api.c b/src/vnet/pg/pg_api.c
index f7fc569a8c0..57fb40cdda4 100644
--- a/src/vnet/pg/pg_api.c
+++ b/src/vnet/pg/pg_api.c
@@ -66,13 +66,13 @@ static void
vl_api_pg_delete_interface_t_handler (vl_api_pg_delete_interface_t *mp)
{
vl_api_pg_delete_interface_reply_t *rmp;
+ pg_main_t *pg = &pg_main;
+ u32 sw_if_index = ~0;
int rv = 0;
VALIDATE_SW_IF_INDEX (mp);
- u32 sw_if_index = ntohl (mp->sw_if_index);
-
- pg_main_t *pg = &pg_main;
+ sw_if_index = ntohl (mp->sw_if_index);
rv = pg_interface_delete (sw_if_index);
@@ -85,14 +85,14 @@ static void
(vl_api_pg_interface_enable_disable_coalesce_t * mp)
{
vl_api_pg_interface_enable_disable_coalesce_reply_t *rmp;
+ pg_main_t *pg = &pg_main;
+ vnet_main_t *vnm = vnet_get_main ();
int rv = 0;
VALIDATE_SW_IF_INDEX (mp);
u32 sw_if_index = ntohl (mp->sw_if_index);
- pg_main_t *pg = &pg_main;
- vnet_main_t *vnm = vnet_get_main ();
vnet_hw_interface_t *hw =
vnet_get_sup_hw_interface_api_visible_or_null (vnm, sw_if_index);