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
|
&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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue