Fix numerous nvme issues - see each commit#1743
Open
spbrogan wants to merge 4 commits intomicrosoft:release/202511from
Open
Fix numerous nvme issues - see each commit#1743spbrogan wants to merge 4 commits intomicrosoft:release/202511from
spbrogan wants to merge 4 commits intomicrosoft:release/202511from
Conversation
This was
linked to
issues
Apr 4, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/202511 #1743 +/- ##
=================================================
Coverage ? 1.58%
=================================================
Files ? 634
Lines ? 232393
Branches ? 420
=================================================
Hits ? 3690
Misses ? 228688
Partials ? 15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
Since this is not causing an active problem, can you take this directly to edk2? We can still review it there. |
73dcd7f to
dec896e
Compare
…ate and protocol opens Why this is a real bug: After allocating Private via AllocateZeroPool (line ~1201) 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. Why this is NOT a false positive: The Exit: label at line ~1340 performs FreePool(Private), gBS->CloseProtocol(PciIo), and gBS->CloseProtocol(DevicePath). The direct return skips all of these. No other caller cleans up Private or closes the protocols. Consequence: Memory leak of NVME_CONTROLLER_PRIVATE_DATA. Two protocols remain opened BY_DRIVER on the controller handle, preventing other drivers from binding.
…Nvme Media Sanitize Unit tests
dec896e to
2b5dbe0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix numerous nvme issues - see each commit.
fixes #1739, #1738, #1744
For details on how to complete these options and their meaning refer to CONTRIBUTING.md.
How This Was Tested
Host based unit tests authored to show failure.
Host based unit tests passed after changes
Integration Instructions
None. Existing module.