Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Nov 2018 17:57:13 +0000 (UTC)
From:      Julien Charbon <jch@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r340375 - head/sys/dev/cxgbe
Message-ID:  <201811121757.wACHvDrW065531@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811121757.wACHvDrW065531>