From 6c1906e43eb910c9799ec2c4b9b81bfa1fc9f9ea Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Tue, 6 Oct 2015 16:53:56 +0200 Subject: [PATCH] platform_drv: clear bdf_in_use if set Fixes #1740 --- .../src/drivers/platform/spec/x86/pci_session_component.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h index 976a5e88c..2919bc077 100644 --- a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h +++ b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h @@ -572,8 +572,11 @@ namespace Platform { unsigned const dev = device->config().device_number(); unsigned const func = device->config().function_number(); - bdf_in_use.clear(Device_config::MAX_BUSES * bus + - Device_config::MAX_DEVICES * dev + func, 1); + if (bdf_in_use.get(Device_config::MAX_BUSES * bus + + Device_config::MAX_DEVICES * dev + + func, 1)) + bdf_in_use.clear(Device_config::MAX_BUSES * bus + + Device_config::MAX_DEVICES * dev + func, 1); _device_list.remove(device); _ep->dissolve(device);