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
This commit is contained in:
Roger Pau Monné 2018-05-24 10:20:42 +00:00
parent e2e4a0e02a
commit 791ca5907a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334146

View File

@ -474,10 +474,10 @@ evtchn_ioctl(struct cdev *dev, unsigned long cmd, caddr_t arg,
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;