svn commit: r345793 - stable/11/sys/kern
Marcin Wojtas
mw at FreeBSD.org
Tue Apr 2 08:43:20 UTC 2019
Author: mw
Date: Tue Apr 2 08:43:19 2019
New Revision: 345793
URL: https://svnweb.freebsd.org/changeset/base/345793
Log:
MFC r344676: Prevent detaching driver if the attach is not finished
Submitted by: Rafal Kozik <rk at semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Modified:
stable/11/sys/kern/subr_bus.c
Modified: stable/11/sys/kern/subr_bus.c
==============================================================================
--- stable/11/sys/kern/subr_bus.c Tue Apr 2 08:35:24 2019 (r345792)
+++ stable/11/sys/kern/subr_bus.c Tue Apr 2 08:43:19 2019 (r345793)
@@ -2964,6 +2964,10 @@ device_detach(device_t dev)
PDEBUG(("%s", DEVICENAME(dev)));
if (dev->state == DS_BUSY)
return (EBUSY);
+ if (dev->state == DS_ATTACHING) {
+ device_printf(dev, "device in attaching state! Deferring detach.\n");
+ return (EBUSY);
+ }
if (dev->state != DS_ATTACHED)
return (0);
More information about the svn-src-stable
mailing list