summaryrefslogtreecommitdiffhomepage
path: root/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'device.c')
-rw-r--r--device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/device.c b/device.c
index 6f31e36..59a57f4 100644
--- a/device.c
+++ b/device.c
@@ -704,6 +704,7 @@ device_replace(struct device *dev, struct device *odev)
struct device_user *dep, *tmp;
bool present = odev->present;
+ __devlock++;
if (present)
device_set_present(odev, false);
@@ -713,6 +714,8 @@ device_replace(struct device *dev, struct device *odev)
safe_list_add(&dep->list, &dev->users);
dep->dev = dev;
}
+ __devlock--;
+
device_free(odev);
if (present)