summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2021-05-14 15:33:01 -0700
committerMatthew Smith <mgsmith@netgate.com>2021-05-15 23:49:42 +0000
commita7ec31750ca3d240adc3f6b3d9d189885b02d6df (patch)
treea86c514f19a4644fc2e7689d0fa5e84f3c25938c /src
parentd5a588230f3e05fd496939bea304fca84a687fa3 (diff)
lacp: coverity fix on null pointer dereference
Coverity complains on null pointer dereference. It is not likely to happen. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Iab726a1e2d60725cec7ab0bbd2787b62e6393d33
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lacp/selection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/lacp/selection.c b/src/plugins/lacp/selection.c
index 0c9f036308d..1588ebfd2eb 100644
--- a/src/plugins/lacp/selection.c
+++ b/src/plugins/lacp/selection.c
@@ -40,8 +40,8 @@ lacp_set_port_selected (vlib_main_t *vm, bond_if_t *bif, member_if_t *mif)
{
p = *vec_elt_at_index (bif->active_members, 0);
mif2 = bond_get_member_by_sw_if_index (p);
- if ((mif2->partner.key != mif->partner.key) ||
- memcmp (mif2->partner.system, mif->partner.system, 6))
+ if (mif2 && ((mif2->partner.key != mif->partner.key) ||
+ memcmp (mif2->partner.system, mif->partner.system, 6)))
{
mif->selected = LACP_PORT_UNSELECTED;
lacp_machine_dispatch (&lacp_mux_machine, vm, mif,