Fix PCI driver detaching

master
Jiajie Chen 6 years ago
parent a0d9a8b2de
commit c6be460228

@ -305,8 +305,12 @@ pub fn init_driver(name: String, vid: u32, did: u32, tag: PciTag) {
pub fn detach_driver(tag: &PciTag) -> bool {
match PCI_DRIVERS.lock().remove(tag) {
Some(driver) => {
DRIVERS.write().retain(|dri| dri.get_id() != driver.get_id());
NET_DRIVERS.write().retain(|dri| dri.get_id() != driver.get_id());
DRIVERS
.write()
.retain(|dri| dri.get_id() != driver.get_id());
NET_DRIVERS
.write()
.retain(|dri| dri.get_id() != driver.get_id());
true
}
None => false,

Loading…
Cancel
Save