aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cxgbe/t4_l2t.c
diff options
context:
space:
mode:
authorNavdeep Parhar <np@FreeBSD.org>2016-07-01 23:18:49 +0000
committerNavdeep Parhar <np@FreeBSD.org>2016-07-01 23:18:49 +0000
commitbf9363d72cf3c04da8385101441b37a9a9c20754 (patch)
tree47277d65b4aefd79efed00607b745386f829de82 /sys/dev/cxgbe/t4_l2t.c
parent5ecf8e3852a9ec0d8706be1f786e1693773377d3 (diff)
cxgbe(4): Avoid a NULL dereference while dumping the L2 table. Entries
used by switching filters that rewrite L2 information do not have any associated ifnet. Approved by: re@ (gjb@) Sponsored by: Chelsio Communications
Notes
Notes: svn path=/head/; revision=302313
Diffstat (limited to 'sys/dev/cxgbe/t4_l2t.c')
-rw-r--r--sys/dev/cxgbe/t4_l2t.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/dev/cxgbe/t4_l2t.c b/sys/dev/cxgbe/t4_l2t.c
index cab5cc28ce8c..7c4cedefb280 100644
--- a/sys/dev/cxgbe/t4_l2t.c
+++ b/sys/dev/cxgbe/t4_l2t.c
@@ -307,7 +307,6 @@ sysctl_l2t(SYSCTL_HANDLER_ARGS)
}
/*
- * XXX: e->ifp may not be around.
* XXX: IPv6 addresses may not align properly in the output.
*/
sbuf_printf(sb, "\n%4u %-15s %02x:%02x:%02x:%02x:%02x:%02x %4d"
@@ -316,7 +315,7 @@ sysctl_l2t(SYSCTL_HANDLER_ARGS)
e->dmac[3], e->dmac[4], e->dmac[5],
e->vlan & 0xfff, vlan_prio(e), e->lport,
l2e_state(e), atomic_load_acq_int(&e->refcnt),
- e->ifp->if_xname);
+ e->ifp ? e->ifp->if_xname : "-");
skip:
mtx_unlock(&e->lock);
}