Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jul 2017 23:59:11 +0000 (UTC)
From:      Zbigniew Bodek <zbb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320625 - head/sys/dev/ena
Message-ID:  <201707032359.v63NxBc1079001@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: zbb
Date: Mon Jul  3 23:59:11 2017
New Revision: 320625
URL: https://svnweb.freebsd.org/changeset/base/320625

Log:
  Add missing lock upon initialization of the interface
  
  Lack of this lock was causing crash if down was called in
  parallel with the initialization routine.
  
  Submitted by:   Michal Krawczyk <mk@semihalf.com>
  Obtained from:  Semihalf
  Sponsored by:   Amazon.com Inc.

Modified:
  head/sys/dev/ena/ena.c

Modified: head/sys/dev/ena/ena.c
==============================================================================
--- head/sys/dev/ena/ena.c	Mon Jul  3 23:54:39 2017	(r320624)
+++ head/sys/dev/ena/ena.c	Mon Jul  3 23:59:11 2017	(r320625)
@@ -2276,8 +2276,11 @@ ena_init(void *arg)
 {
 	struct ena_adapter *adapter = (struct ena_adapter *)arg;
 
-	if (adapter->up == false)
+	if (adapter->up == false) {
+		sx_xlock(&adapter->ioctl_sx);
 		ena_up(adapter);
+		sx_unlock(&adapter->ioctl_sx);
+	}
 
 	return;
 }



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