From 9388c6b1c17af9c8a9f451a42c066b3ae7d81fda Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Sat, 7 Sep 2019 00:50:42 +0200 Subject: [PATCH] MdeModulePkg: fix UninstallMultipleProtocolInterfaces() calls Unlike the InstallMultipleProtocolInterfaces() boot service, which takes an (EFI_HANDLE*) as first parameter, the UninstallMultipleProtocolInterfaces() boot service takes an EFI_HANDLE as first parameter. These are actual bugs. They must have remained hidden until now because they are on error paths. Fix the UninstallMultipleProtocolInterfaces() calls. Cc: Hao A Wu Cc: Jian J Wang Cc: Ray Ni Signed-off-by: Laszlo Ersek Reviewed-by: Ray Ni Reviewed-by: Hao A Wu --- MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c | 2 +- MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c | 2 +- MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 6 +++--- MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c | 2 +- MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c | 2 +- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 2 +- MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c b/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c index 2b54ec51dc..ed33a51da2 100644 --- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c +++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c @@ -720,7 +720,7 @@ Error: if (I2cBusContext != NULL) { Status = gBS->UninstallMultipleProtocolInterfaces ( - &Controller, + Controller, gEfiCallerIdGuid, I2cBusContext, NULL diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c index c6e401176a..3bde96bc95 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c @@ -244,7 +244,7 @@ EnumerateNvmeDevNamespace ( ); if(EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( - &Device->DeviceHandle, + Device->DeviceHandle, &gEfiDevicePathProtocolGuid, Device->DevicePath, &gEfiBlockIoProtocolGuid, diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index b7832c6970..292dd25da8 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -313,7 +313,7 @@ RegisterPciDevice ( ); if (EFI_ERROR (Status)) { gBS->UninstallMultipleProtocolInterfaces ( - &PciIoDevice->Handle, + PciIoDevice->Handle, &gEfiDevicePathProtocolGuid, PciIoDevice->DevicePath, &gEfiPciIoProtocolGuid, @@ -351,7 +351,7 @@ RegisterPciDevice ( ); if (EFI_ERROR (Status)) { gBS->UninstallMultipleProtocolInterfaces ( - &PciIoDevice->Handle, + PciIoDevice->Handle, &gEfiDevicePathProtocolGuid, PciIoDevice->DevicePath, &gEfiPciIoProtocolGuid, @@ -360,7 +360,7 @@ RegisterPciDevice ( ); if (HasEfiImage) { gBS->UninstallMultipleProtocolInterfaces ( - &PciIoDevice->Handle, + PciIoDevice->Handle, &gEfiLoadFile2ProtocolGuid, &PciIoDevice->LoadFile2, NULL diff --git a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c index 82db93a8b1..9fe8a482e0 100644 --- a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c +++ b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c @@ -665,7 +665,7 @@ CreateSerialDevice ( if (EFI_ERROR (Status)) { gBS->UninstallMultipleProtocolInterfaces ( - &SerialDevice->Handle, + SerialDevice->Handle, &gEfiDevicePathProtocolGuid, SerialDevice->DevicePath, &gEfiSerialIoProtocolGuid, &SerialDevice->SerialIo, NULL diff --git a/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c b/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c index 62f18d1878..e2ae56c505 100644 --- a/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c +++ b/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c @@ -475,7 +475,7 @@ InstallProtocolOnPartition ( ); if (EFI_ERROR (Status)) { gBS->UninstallMultipleProtocolInterfaces ( - &Partition->Handle, + Partition->Handle, &gEfiDevicePathProtocolGuid, Partition->DevicePath, &gEfiBlockIoProtocolGuid, diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c index eaa0d70024..cc0de52de4 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c @@ -159,7 +159,7 @@ UsbCreateInterface ( if (EFI_ERROR (Status)) { gBS->UninstallMultipleProtocolInterfaces ( - &UsbIf->Handle, + UsbIf->Handle, &gEfiDevicePathProtocolGuid, UsbIf->DevicePath, &gEfiUsbIoProtocolGuid, diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c index 8c27e18cdb..0dcbc5da2c 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c @@ -575,7 +575,7 @@ UsbMassInitMultiLun ( if (EFI_ERROR (Status)) { DEBUG ((EFI_D_ERROR, "UsbMassInitMultiLun: OpenUsbIoProtocol By Child (%r)\n", Status)); gBS->UninstallMultipleProtocolInterfaces ( - &UsbMass->Controller, + UsbMass->Controller, &gEfiDevicePathProtocolGuid, UsbMass->DevicePath, &gEfiBlockIoProtocolGuid, -- 2.39.2