If the driver does not start before, we do not disconnect driver and we must still uninstall other protocols on image handle. The original implementation of error return is not correct.

Signed-off-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15069 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Elvin Li 2014-01-09 08:47:03 +00:00 committed by li-elvin
parent e6aaef28b8
commit 2fa77862fd
2 changed files with 28 additions and 32 deletions

View File

@ -1424,22 +1424,20 @@ I2cBusUnload (
&DeviceHandleBuffer &DeviceHandleBuffer
); );
if (EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
return Status; //
} // Disconnect the driver specified by Driver BindingHandle from all
// the devices in the handle database.
// //
// Disconnect the driver specified by Driver BindingHandle from all for (Index = 0; Index < DeviceHandleCount; Index++) {
// the devices in the handle database. Status = gBS->DisconnectController (
// DeviceHandleBuffer[Index],
for (Index = 0; Index < DeviceHandleCount; Index++) { gI2cBusDriverBinding.DriverBindingHandle,
Status = gBS->DisconnectController ( NULL
DeviceHandleBuffer[Index], );
gI2cBusDriverBinding.DriverBindingHandle, if (EFI_ERROR (Status)) {
NULL goto Done;
); }
if (EFI_ERROR (Status)) {
goto Done;
} }
} }

View File

@ -1147,22 +1147,20 @@ I2cHostUnload (
&DeviceHandleBuffer &DeviceHandleBuffer
); );
if (EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
return Status; //
} // Disconnect the driver specified by ImageHandle from all
// the devices in the handle database.
// //
// Disconnect the driver specified by ImageHandle from all for (Index = 0; Index < DeviceHandleCount; Index++) {
// the devices in the handle database. Status = gBS->DisconnectController (
// DeviceHandleBuffer[Index],
for (Index = 0; Index < DeviceHandleCount; Index++) { ImageHandle,
Status = gBS->DisconnectController ( NULL
DeviceHandleBuffer[Index], );
ImageHandle, if (EFI_ERROR (Status)) {
NULL goto Done;
); }
if (EFI_ERROR (Status)) {
goto Done;
} }
} }