public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: edk2-devel-groups-io <devel@edk2.groups.io>
Cc: Hao A Wu <hao.a.wu@intel.com>,
	Jian J Wang <jian.j.wang@intel.com>, Ray Ni <ray.ni@intel.com>
Subject: [PATCH 14/35] MdeModulePkg: fix UninstallMultipleProtocolInterfaces() calls
Date: Tue, 17 Sep 2019 21:49:14 +0200	[thread overview]
Message-ID: <20190917194935.24322-15-lersek@redhat.com> (raw)
In-Reply-To: <20190917194935.24322-1-lersek@redhat.com>

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 <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---

Notes:
    build-tested only

 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 2b54ec51dca0..ed33a51da252 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 c6e401176a4b..3bde96bc9576 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 b7832c6970ad..292dd25da817 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 82db93a8b117..9fe8a482e067 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 62f18d1878bd..e2ae56c5058a 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 eaa0d70024bb..cc0de52de411 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 8c27e18cdb87..0dcbc5da2cb8 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.19.1.3.g30247aa5d201



  parent reply	other threads:[~2019-09-17 19:50 UTC|newest]

Thread overview: 155+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17 19:49 [PATCH 00/35] edk2: clean up the usage of standardized (VOID*) typedefs Laszlo Ersek
2019-09-17 19:49 ` [PATCH 01/35] DO NOT APPLY: edk2: turn standard handle types into pointers to non-VOID Laszlo Ersek
2019-09-17 20:06   ` [edk2-devel] " Ni, Ray
2019-09-17 20:22     ` Andrew Fish
2019-09-17 20:28       ` Ni, Ray
2019-09-17 21:07         ` Andrew Fish
2019-09-17 21:11           ` Michael D Kinney
2019-09-18  8:41       ` Laszlo Ersek
2019-09-18 15:16         ` Michael D Kinney
2019-09-18 17:41           ` Laszlo Ersek
2019-09-18 15:55         ` Andrew Fish
2019-09-18 16:16           ` Leif Lindholm
2019-09-18 17:45           ` Laszlo Ersek
2019-09-18  8:36     ` Laszlo Ersek
2019-09-17 19:49 ` [PATCH 02/35] EmbeddedPkg: add missing EFIAPI calling convention specifiers Laszlo Ersek
2019-09-18 17:41   ` Leif Lindholm
2019-09-17 19:49 ` [PATCH 03/35] EmbeddedPkg/AndroidFastbootTransportTcpDxe: fix DestroyChild() call Laszlo Ersek
2019-09-24 10:47   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-26 12:12   ` Laszlo Ersek
2019-09-26 12:16   ` Ard Biesheuvel
2019-09-17 19:49 ` [PATCH 04/35] EmbeddedPkg/Universal/MmcDxe: "fix" CloseProtocol() call in BindingStop() Laszlo Ersek
2019-09-25 15:52   ` Ard Biesheuvel
2019-09-17 19:49 ` [PATCH 05/35] EmulatorPkg/DxeTimerLib: drop superfluous cast Laszlo Ersek
2019-09-17 20:02   ` Ni, Ray
2019-09-20 15:00   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-17 19:49 ` [PATCH 06/35] EmulatorPkg: stop abusing EFI_HANDLE for keystroke notify registration Laszlo Ersek
2019-09-17 20:01   ` Ni, Ray
2019-09-24 10:44   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-17 19:49 ` [PATCH 07/35] MdeModulePkg: fix cast in GetModuleInfoFromHandle() calls Laszlo Ersek
2019-09-19  1:46   ` Dandan Bi
2019-09-24 10:43   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-17 19:49 ` [PATCH 08/35] MdeModulePkg/UefiHiiLib: stop using EFI_HANDLE in place of EFI_HII_HANDLE Laszlo Ersek
2019-09-19  1:46   ` Dandan Bi
2019-09-24 10:49   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-17 19:49 ` [PATCH 09/35] MdeModulePkg: stop abusing EFI_EVENT for protocol notify registration Laszlo Ersek
2019-09-17 20:17   ` Ni, Ray
2019-09-25 16:02   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-26 12:10     ` Laszlo Ersek
2019-09-17 19:49 ` [PATCH 10/35] MdeModulePkg/PlatformVarCleanupLib: fix HiiConstructConfigHdr() call Laszlo Ersek
2019-09-23 11:45   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-24 17:28     ` Laszlo Ersek
2019-09-17 19:49 ` [PATCH 11/35] MdeModulePkg: document workaround for EFI_RUNTIME_EVENT_ENTRY PI spec bug Laszlo Ersek
2019-09-19  1:47   ` Dandan Bi
2019-09-17 19:49 ` [PATCH 12/35] MdeModulePkg: stop abusing EFI_HANDLE for keystroke notify registration Laszlo Ersek
2019-09-17 20:16   ` [edk2-devel] " Ni, Ray
2019-09-19  1:47   ` Dandan Bi
2019-09-24 10:54   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-17 19:49 ` [PATCH 13/35] MdeModulePkg: PEI Core: clean up "AprioriFile" handling in FindFileEx() Laszlo Ersek
2019-09-19  1:46   ` Dandan Bi
2019-09-24 15:40   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-17 19:49 ` Laszlo Ersek [this message]
2019-09-17 20:16   ` [PATCH 14/35] MdeModulePkg: fix UninstallMultipleProtocolInterfaces() calls Ni, Ray
2019-09-17 19:49 ` [PATCH 15/35] MdeModulePkg/PiSmmCore: make type punning consistent Laszlo Ersek
2019-09-18  2:38   ` Dong, Eric
2019-09-17 19:49 ` [PATCH 16/35] MdeModulePkg/S3SaveState: cast Position for S3BootScriptLib explicitly Laszlo Ersek
2019-09-19  1:47   ` [edk2-devel] " Dandan Bi
2019-09-17 19:49 ` [PATCH 17/35] MdePkg/DxeServicesLib: remove bogus cast Laszlo Ersek
2019-09-18  4:47   ` [edk2-devel] " Liming Gao
2019-09-24 15:38   ` Philippe Mathieu-Daudé
2019-09-17 19:49 ` [PATCH 18/35] NetworkPkg/DxeNetLib: fix type typo in NetLibGetMacAddress() Laszlo Ersek
2019-09-24 11:00   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-10-08  0:32     ` Siyuan, Fu
2019-10-08 23:36       ` Laszlo Ersek
2019-09-26 12:14   ` Laszlo Ersek
2019-10-03 11:05     ` Laszlo Ersek
2019-10-04 19:18       ` Laszlo Ersek
2019-10-07 18:15   ` Michael D Kinney
2019-09-17 19:49 ` [PATCH 19/35] NetworkPkg: fix CloseProtocol & UninstallMultipleProtocolInterfaces calls Laszlo Ersek
2019-09-26 12:14   ` [edk2-devel] " Laszlo Ersek
2019-09-26 12:42   ` Philippe Mathieu-Daudé
2019-09-30 20:16     ` Laszlo Ersek
2019-10-01  7:18       ` Philippe Mathieu-Daudé
2019-09-27  0:03   ` Siyuan, Fu
2019-09-17 19:49 ` [PATCH 20/35] NetworkPkg/Ip4Dxe: fix NetLibDestroyServiceChild() call Laszlo Ersek
2019-09-23 16:03   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-27  0:04     ` Siyuan, Fu
2019-09-26 12:14   ` Laszlo Ersek
2019-09-17 19:49 ` [PATCH 21/35] NetworkPkg/TcpDxe: fix SockFreeFoo() parameter list Laszlo Ersek
2019-09-23 15:09   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-26 12:14   ` Laszlo Ersek
2019-09-27  0:06   ` Siyuan, Fu
2019-09-17 19:49 ` [PATCH 22/35] OvmfPkg/XenBusDxe: fix UninstallMultipleProtocolInterfaces() call Laszlo Ersek
2019-09-18  9:32   ` Anthony PERARD
2019-09-18 10:30   ` Julien Grall
2019-09-23 15:03   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-17 19:49 ` [PATCH 23/35] OvmfPkg/VirtioNetDxe: fix SignalEvent() call Laszlo Ersek
2019-09-20 14:59   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-26 12:16   ` Laszlo Ersek
2019-09-26 12:17   ` Ard Biesheuvel
2019-09-17 19:49 ` [PATCH 24/35] OvmfPkg/PlatformDxe: fix EFI_HII_HANDLE parameters of internal functions Laszlo Ersek
2019-09-20 14:56   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-25 15:57   ` Ard Biesheuvel
2019-09-17 19:49 ` [PATCH 25/35] OvmfPkg/VideoDxe: document EFI_EDID_OVERRIDE_PROTOCOL.GetEdid() call Laszlo Ersek
2019-09-23 15:59   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-26 12:43     ` Laszlo Ersek
2019-10-04 20:01       ` Laszlo Ersek
2019-09-17 19:49 ` [PATCH 26/35] SecurityPkg: fix UninstallMultipleProtocolInterfaces() calls Laszlo Ersek
2019-09-23  9:55   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-26 12:45   ` Laszlo Ersek
2019-10-03 11:06     ` Laszlo Ersek
2019-10-04  0:05       ` Yao, Jiewen
2019-10-04 13:14       ` Zhang, Chao B
2019-10-04 18:15         ` Laszlo Ersek
2019-10-05 14:28       ` Zhang, Chao B
2019-10-07 18:14         ` Laszlo Ersek
2019-09-17 19:49 ` [PATCH 27/35] SecurityPkg: stop abusing EFI_EVENT for protocol notify registration Laszlo Ersek
2019-09-23  9:56   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-26 12:46   ` Laszlo Ersek
2019-10-03 11:06     ` Laszlo Ersek
2019-10-04  0:05       ` Yao, Jiewen
2019-10-04 13:16       ` Zhang, Chao B
2019-10-05 14:28       ` Zhang, Chao B
2019-09-17 19:49 ` [PATCH 28/35] ShellPkg/UefiShellDriver1CommandsLib: fix parameter list typo Laszlo Ersek
2019-09-24 15:44   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-26  2:46   ` Gao, Zhichao
2019-09-17 19:49 ` [PATCH 29/35] ShellPkg: stop using EFI_HANDLE in place of EFI_HII_HANDLE Laszlo Ersek
2019-09-25 18:04   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-26 11:48     ` Laszlo Ersek
2019-09-26  2:43   ` Gao, Zhichao
2019-09-17 19:49 ` [PATCH 30/35] ShellPkg: stop taking EFI_HANDLE in place of SHELL_FILE_HANDLE Laszlo Ersek
2019-09-23  9:58   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-26  2:53   ` Gao, Zhichao
2019-09-26 12:08     ` Laszlo Ersek
2019-09-26 14:43       ` Gao, Zhichao
2019-09-30 19:52         ` Laszlo Ersek
2019-09-17 19:49 ` [PATCH 31/35] ShellPkg/UefiShellDebug1CommandsLib: fix ShellCloseFile() call Laszlo Ersek
2019-09-23 10:01   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-23 14:28     ` Carsey, Jaben
2019-09-24  1:18       ` Gao, Zhichao
2019-09-17 19:49 ` [PATCH 32/35] ShellPkg/UefiShellLib: clarify workaround for unfixable EdkShell bug Laszlo Ersek
2019-09-26 12:47   ` [edk2-devel] " Laszlo Ersek
2019-09-26 14:05     ` Gao, Zhichao
2019-09-26 14:58     ` Carsey, Jaben
2019-09-17 19:49 ` [PATCH 33/35] StandaloneMmPkg/Core: stop abusing EFI_HANDLE for FwVolHeader tracking Laszlo Ersek
2019-09-26 12:48   ` [edk2-devel] " Laszlo Ersek
2019-10-03 11:10     ` Laszlo Ersek
2019-10-03 11:17       ` Achin Gupta
2019-10-04  0:10       ` Yao, Jiewen
2019-10-04 14:53       ` Achin Gupta
2019-09-17 19:49 ` [PATCH 34/35] UefiPayloadPkg/BlSupportPei: fix MMCONFIG assignment from XSDT Laszlo Ersek
2019-09-23  2:30   ` Guo Dong
2019-09-26 13:17   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-17 19:49 ` [PATCH 35/35] UefiPayloadPkg/BlSupportDxe: fix ReserveResourceInGcd() calls Laszlo Ersek
2019-09-23  2:28   ` [edk2-devel] " Guo Dong
2019-09-23 15:08   ` Philippe Mathieu-Daudé
2019-09-23 16:02     ` Guo Dong
2019-09-23 16:04       ` Philippe Mathieu-Daudé
2019-09-24 17:29     ` Laszlo Ersek
2019-09-19  0:32 ` [edk2-devel] [PATCH 00/35] edk2: clean up the usage of standardized (VOID*) typedefs Wu, Hao A
2019-09-23 16:27 ` Marvin Häuser
2019-09-24 20:26   ` Laszlo Ersek
2019-09-25  8:13     ` Marvin Häuser
2019-09-25 15:54       ` Laszlo Ersek
2019-10-08 23:49 ` Laszlo Ersek
2019-10-09  9:50   ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190917194935.24322-15-lersek@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox