From b46a4e69e5db18ef792415439d04a0ab22c59386 Mon Sep 17 00:00:00 2001 From: Andrew Yourtchenko Date: Tue, 23 Aug 2022 15:38:05 +0000 Subject: ethernet: fix coverity 218549 Check that the pointer is non-null before dereferencing it. Type: fix Signed-off-by: Andrew Yourtchenko Change-Id: I611a1042d08bbe455dd09a4fa5711fe86c440240 --- src/vnet/ethernet/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vnet/ethernet') diff --git a/src/vnet/ethernet/node.c b/src/vnet/ethernet/node.c index 214e68809cc..21346a80658 100644 --- a/src/vnet/ethernet/node.c +++ b/src/vnet/ethernet/node.c @@ -225,7 +225,7 @@ identify_subint (ethernet_main_t * em, // A unicast packet arriving on an L3 interface must have a dmac // matching the interface mac. If interface has STATUS_L3 bit set // mac filter is already done. - if (!(*is_l2 || (ei->flags & ETHERNET_INTERFACE_FLAG_STATUS_L3))) + if (!(*is_l2 || (ei && (ei->flags & ETHERNET_INTERFACE_FLAG_STATUS_L3)))) { u64 dmacs[2]; u8 dmacs_bad[2]; -- cgit 1.2.3-korg