diff --git a/src/add-ons/kernel/drivers/graphics/intel_extreme/driver.cpp b/src/add-ons/kernel/drivers/graphics/intel_extreme/driver.cpp index 8a706e9c70..c6f340fa10 100644 --- a/src/add-ons/kernel/drivers/graphics/intel_extreme/driver.cpp +++ b/src/add-ons/kernel/drivers/graphics/intel_extreme/driver.cpp @@ -131,8 +131,10 @@ init_driver(void) } status = init_lock(&gLock, "intel extreme ksync"); - if (status < B_OK) + if (status < B_OK) { + put_module(B_PCI_MODULE_NAME); return status; + } // find devices diff --git a/src/add-ons/kernel/drivers/graphics/radeon/driver.c b/src/add-ons/kernel/drivers/graphics/radeon/driver.c index a5e777599b..6ae7abd39a 100644 --- a/src/add-ons/kernel/drivers/graphics/radeon/driver.c +++ b/src/add-ons/kernel/drivers/graphics/radeon/driver.c @@ -155,6 +155,8 @@ status_t init_driver( void ) devices = (radeon_devices *)calloc( 1, sizeof( radeon_devices )); if( devices == NULL ) { put_module(B_PCI_MODULE_NAME); + if (agp_bus != NULL) + put_module(B_AGP_MODULE_NAME); return B_ERROR; } @@ -177,7 +179,8 @@ void uninit_driver( void ) put_module( B_PCI_MODULE_NAME ); /* put the agp module away if it's there */ - if (agp_bus) put_module(B_AGP_MODULE_NAME); + if (agp_bus) + put_module(B_AGP_MODULE_NAME); } diff --git a/src/add-ons/kernel/drivers/graphics/via/driver.c b/src/add-ons/kernel/drivers/graphics/via/driver.c index d36ef98bcc..1a26210f45 100644 --- a/src/add-ons/kernel/drivers/graphics/via/driver.c +++ b/src/add-ons/kernel/drivers/graphics/via/driver.c @@ -284,6 +284,9 @@ init_driver(void) { /* driver private data */ pd = (DeviceData *)calloc(1, sizeof(DeviceData)); if (!pd) { + if (agp_bus) + put_module(B_AGP_MODULE_NAME); + put_module(B_ISA_MODULE_NAME); put_module(B_PCI_MODULE_NAME); return B_ERROR; } @@ -324,7 +327,8 @@ void uninit_driver(void) { put_module(B_ISA_MODULE_NAME); /* put the agp module away if it's there */ - if (agp_bus) put_module(B_AGP_MODULE_NAME); + if (agp_bus) + put_module(B_AGP_MODULE_NAME); } static status_t map_device(device_info *di)