cxgbe/netmap: Fix cxgbe netmap when interface is DOWN

A kernel panic can occur if the cxgbe interface is DOWN
when activating netmap. This patch prevents the driver
from freeing up cxgbe netmap resources when they have not
been allocated.

Submitted by:	Nicolas Witkowski <nwitkowski@verisign.com>
Reviewed by:	np
MFC after:	1 week
Sponsored by:	Verisign, Inc.
Differential Revision:	https://reviews.freebsd.org/D17802
This commit is contained in:
jch 2018-11-12 17:57:12 +00:00
parent edb0e63404
commit 10487ea181

View File

@ -492,6 +492,9 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *vi, struct ifnet *ifp,
ASSERT_SYNCHRONIZED_OP(sc);
if (!nm_netmap_on(na))
return (0);
if ((vi->flags & VI_INIT_DONE) == 0)
return (0);