ahci: throw exception if device can not be found

Fixes #1183
This commit is contained in:
Alexander Boettcher 2014-06-17 13:54:06 +02:00 committed by Norman Feske
parent b8798fc026
commit b4e86cc499
1 changed files with 10 additions and 1 deletions

View File

@ -42,7 +42,16 @@ class Ahci_driver : public Ahci_pci_connection,
/**
* Constructor
*/
Ahci_driver() : Ahci_driver_base(Ahci_device::probe(_pci)) { }
Ahci_driver() : Ahci_driver_base(nullptr) {
Ahci_device * device = Ahci_device::probe(_pci);
if (!device) {
PWRN("Could not find ahci device");
throw Root::Unavailable();
}
_device = device;
}
};
#endif /* _AHCI_DRIVER_H_ */