Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 May 2018 10:20:43 +0000 (UTC)
From:      =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334146 - head/sys/dev/xen/evtchn
Message-ID:  <201805241020.w4OAKhF6076997@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger
Date: Thu May 24 10:20:42 2018
New Revision: 334146
URL: https://svnweb.freebsd.org/changeset/base/334146

Log:
  xen/evtchn: fix LOR in evtchn device
  
  Remove the device from the list before unbinding it. Doing it in this
  order allows calling xen_intr_unbind without holding the bind_mutex
  lock.
  
  Sponsored by:	Citrix Systems R&D

Modified:
  head/sys/dev/xen/evtchn/evtchn_dev.c

Modified: head/sys/dev/xen/evtchn/evtchn_dev.c
==============================================================================
--- head/sys/dev/xen/evtchn/evtchn_dev.c	Thu May 24 10:19:54 2018	(r334145)
+++ head/sys/dev/xen/evtchn/evtchn_dev.c	Thu May 24 10:20:42 2018	(r334146)
@@ -474,10 +474,10 @@ evtchn_ioctl(struct cdev *dev, unsigned long cmd, cadd
 			error = ENOTCONN;
 			break;
 		}
-
-		xen_intr_unbind(&evtchn->handle);
 		RB_REMOVE(evtchn_tree, &u->evtchns, evtchn);
 		mtx_unlock(&u->bind_mutex);
+
+		xen_intr_unbind(&evtchn->handle);
 		free(evtchn, M_EVTCHN);
 		error = 0;
 		break;



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