svn commit: r340375 - head/sys/dev/cxgbe

Julien Charbon jch at FreeBSD.org
Mon Nov 12 17:57:14 UTC 2018


Author: jch
Date: Mon Nov 12 17:57:12 2018
New Revision: 340375
URL: https://svnweb.freebsd.org/changeset/base/340375

Log:
  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 at verisign.com>
  Reviewed by:	np
  MFC after:	1 week
  Sponsored by:	Verisign, Inc.
  Differential Revision:	https://reviews.freebsd.org/D17802

Modified:
  head/sys/dev/cxgbe/t4_netmap.c

Modified: head/sys/dev/cxgbe/t4_netmap.c
==============================================================================
--- head/sys/dev/cxgbe/t4_netmap.c	Mon Nov 12 17:47:51 2018	(r340374)
+++ head/sys/dev/cxgbe/t4_netmap.c	Mon Nov 12 17:57:12 2018	(r340375)
@@ -492,6 +492,9 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v
 
 	ASSERT_SYNCHRONIZED_OP(sc);
 
+	if (!nm_netmap_on(na))
+		return (0);
+
 	if ((vi->flags & VI_INIT_DONE) == 0)
 		return (0);
 


More information about the svn-src-head mailing list