summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
diff options
context:
space:
mode:
authorElvin Li <elvin.li@intel.com>2014-01-09 08:47:03 +0000
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>2014-01-09 08:47:03 +0000
commit2fa77862fd4e962c81524ffd667b62a6adbcff22 (patch)
tree6ac379d747d9606009326cbc41b6e3503c349ae9 /MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
parente6aaef28b8cdc06ae22bdd5c5813746e9495012d (diff)
downloadedk2-platforms-2fa77862fd4e962c81524ffd667b62a6adbcff22.tar.xz
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
Diffstat (limited to 'MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c')
-rw-r--r--MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
index 80314d0660..0cc8e33842 100644
--- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
+++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
@@ -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;
+ }
}
}