aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/subr_bus.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index 1f580f455dc0..5e1b561155bb 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -3145,6 +3145,8 @@ device_set_unit(device_t dev, int unit)
devclass_t dc;
int err;
+ if (unit == dev->unit)
+ return (0);
dc = device_get_devclass(dev);
if (unit < dc->maxunit && dc->devices[unit])
return (EBUSY);