mirror of https://github.com/acidanthera/audk.git
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:
parent
e6aaef28b8
commit
2fa77862fd
|
@ -1424,22 +1424,20 @@ I2cBusUnload (
|
|||
&DeviceHandleBuffer
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Disconnect the driver specified by Driver BindingHandle from all
|
||||
// the devices in the handle database.
|
||||
//
|
||||
for (Index = 0; Index < DeviceHandleCount; Index++) {
|
||||
Status = gBS->DisconnectController (
|
||||
DeviceHandleBuffer[Index],
|
||||
gI2cBusDriverBinding.DriverBindingHandle,
|
||||
NULL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Done;
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// Disconnect the driver specified by Driver BindingHandle from all
|
||||
// the devices in the handle database.
|
||||
//
|
||||
for (Index = 0; Index < DeviceHandleCount; Index++) {
|
||||
Status = gBS->DisconnectController (
|
||||
DeviceHandleBuffer[Index],
|
||||
gI2cBusDriverBinding.DriverBindingHandle,
|
||||
NULL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Done;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1147,22 +1147,20 @@ I2cHostUnload (
|
|||
&DeviceHandleBuffer
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Disconnect the driver specified by ImageHandle from all
|
||||
// the devices in the handle database.
|
||||
//
|
||||
for (Index = 0; Index < DeviceHandleCount; Index++) {
|
||||
Status = gBS->DisconnectController (
|
||||
DeviceHandleBuffer[Index],
|
||||
ImageHandle,
|
||||
NULL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Done;
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// Disconnect the driver specified by ImageHandle from all
|
||||
// the devices in the handle database.
|
||||
//
|
||||
for (Index = 0; Index < DeviceHandleCount; Index++) {
|
||||
Status = gBS->DisconnectController (
|
||||
DeviceHandleBuffer[Index],
|
||||
ImageHandle,
|
||||
NULL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Done;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue