LinuxKPI: Replace missed Giant with bus_topo_lock.

This commit is contained in:
Alexander Motin 2021-12-25 22:02:07 -05:00
parent 22405bb2e4
commit 27ac2b2d49

View file

@ -514,10 +514,10 @@ device_release_driver(struct device *dev)
dev_set_drvdata(dev, NULL);
/* Do not call dev->release! */
mtx_lock(&Giant);
bus_topo_lock();
if (device_is_attached(dev->bsddev))
device_detach(dev->bsddev);
mtx_unlock(&Giant);
bus_topo_unlock();
#endif
}
@ -527,9 +527,9 @@ device_reprobe(struct device *dev)
int error;
device_release_driver(dev);
mtx_lock(&Giant);
bus_topo_lock();
error = device_probe_and_attach(dev->bsddev);
mtx_unlock(&Giant);
bus_topo_unlock();
return (-error);
}