summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--device.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/device.c b/device.c
index e17df13..996ffab 100644
--- a/device.c
+++ b/device.c
@@ -450,6 +450,10 @@ void device_release(struct device_user *dep)
device_broadcast_event(dev, DEV_EVENT_TEARDOWN);
if (!dev->external)
dev->set_state(dev, false);
+
+ if (dev->active)
+ return;
+
device_broadcast_event(dev, DEV_EVENT_DOWN);
}