Author: np
Date: Tue Apr 30 21:24:44 2019
New Revision: 346974
URL: https://svnweb.freebsd.org/changeset/base/346974

Log:
  MFC r340375 (by jch@):
  
  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 <nwitkow...@verisign.com>
  Reviewed by:  np
  Sponsored by: Verisign, Inc.
  Differential Revision:        https://reviews.freebsd.org/D17802

Modified:
  stable/12/sys/dev/cxgbe/t4_netmap.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/t4_netmap.c
==============================================================================
--- stable/12/sys/dev/cxgbe/t4_netmap.c Tue Apr 30 18:48:20 2019        
(r346973)
+++ stable/12/sys/dev/cxgbe/t4_netmap.c Tue Apr 30 21:24:44 2019        
(r346974)
@@ -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);
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to