Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: c3a037c993a8c3fb11e54cc5a5471e7f54bae604
      
https://github.com/tianocore/edk2/commit/c3a037c993a8c3fb11e54cc5a5471e7f54bae604
  Author: Sean Brogan <[email protected]>
  Date:   2026-06-02 (Tue, 02 Jun 2026)

  Changed paths:
    M MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c

  Log Message:
  -----------
  MdeModulePkg: NvmExpressDriverBindingStart - early return path leaks

After allocating Private via AllocateZeroPool and successfully opening
both gEfiDevicePathProtocolGuid and gEfiPciIoProtocolGuid BY_DRIVER,
the function attempts PciIo->Attributes(EfiPciIoAttributeOperationGet)
If this call fails, the code executes return Status instead of goto Exit.

Trigger path:

NvmExpressDriverBindingStart is called.
OpenProtocol for DevicePath succeeds (opens BY_DRIVER).
OpenProtocol for PciIo succeeds (opens BY_DRIVER).
AllocateZeroPool for Private succeeds.
PciIo->Attributes(Get) returns an error.
return Status bypasses the Exit: label.

Consequence:
Memory leak of NVME_CONTROLLER_PRIVATE_DATA. Two protocols remain opened
BY_DRIVER on the controller handle, preventing other drivers from binding.

Signed-off-by: Sean Brogan <[email protected]>



To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to