From: Steven Luong Date: Thu, 4 Mar 2021 00:56:19 +0000 (-0800) Subject: l2: coverity woe in l2_rw_mod_entry X-Git-Tag: v21.10-rc0~413 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F95%2F31495%2F2;p=vpp.git l2: coverity woe in l2_rw_mod_entry Coverity complains that the statement if (!e) return -1; is never true and is logically dead code in the subject function. It is right. e is assigned in both the if and else statementes immediately above and can never be null. Type: fix Signed-off-by: Steven Luong Change-Id: Ic2d0e76eff696ee689a68a07913876dcecf5c647 --- diff --git a/src/vnet/l2/l2_rw.c b/src/vnet/l2/l2_rw.c index a7c95fe1a77..b6de2faffc5 100644 --- a/src/vnet/l2/l2_rw.c +++ b/src/vnet/l2/l2_rw.c @@ -326,9 +326,6 @@ l2_rw_mod_entry (u32 * index, *index = e - rw->entries; } - if (!e) - return -1; - if (is_del) { pool_put (rw->entries, e);