diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2019-01-07 19:54:20 +0100 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2019-01-09 06:10:08 +0000 |
commit | 5f4eb24287c02be6f694f6698472ef4978a5e300 (patch) | |
tree | e2c783676924b71c7662176728db0b0720797470 /src/plugins/gbp/gbp_recirc.c | |
parent | e3034cdc74f9fe153259a55c03846495d3f9f088 (diff) |
gbp: Fix coverity warnings
Change-Id: Iea64d246008b298edeeae338d781b79362f42046
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/plugins/gbp/gbp_recirc.c')
-rw-r--r-- | src/plugins/gbp/gbp_recirc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/gbp/gbp_recirc.c b/src/plugins/gbp/gbp_recirc.c index d907be01b3c..cee63811bd8 100644 --- a/src/plugins/gbp/gbp_recirc.c +++ b/src/plugins/gbp/gbp_recirc.c @@ -171,12 +171,14 @@ gbp_recirc_add (u32 sw_if_index, epg_id_t epg_id, u8 is_ext) return (0); } -void +int gbp_recirc_delete (u32 sw_if_index) { gbp_recirc_t *gr; index_t gri; + if (vec_len (gbp_recirc_db) <= sw_if_index) + return VNET_API_ERROR_INVALID_SW_IF_INDEX; gri = gbp_recirc_db[sw_if_index]; if (INDEX_INVALID != gri) @@ -214,7 +216,9 @@ gbp_recirc_delete (u32 sw_if_index) gbp_endpoint_group_unlock (gr->gr_epgi); gbp_recirc_db[sw_if_index] = INDEX_INVALID; pool_put (gbp_recirc_pool, gr); + return (0); } + return VNET_API_ERROR_NO_SUCH_ENTRY; } void |