Skip to content

Commit

Permalink
netkvm: deregister miniport in erroneous path
Browse files Browse the repository at this point in the history
https://issues.redhat.com/browse/RHEL-68725

The problem can be reproduced under driver verifier with
low resource simulation. If the miniport is registered
but the protocol fail to register we need to deregister
the miniport. Otherwise in future attempts to load the driver
the NDIS enters erroneous state and may issue BSOD. Example of
BSOD: BUGCODE_NDIS_DRIVER/NDIS_BUGCHECK_REFCOUNT_IMBALANCE.

Signed-off-by: Yuri Benditovich <[email protected]>
  • Loading branch information
ybendito committed Nov 29, 2024
1 parent 379f291 commit 9991311
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NetKVM/wlh/ParaNdis6_Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,10 @@ NTSTATUS DriverEntry(PDRIVER_OBJECT pDriverObject, PUNICODE_STRING pRegistryPath
else
{
DEBUG_EXIT_STATUS(0, status);
if (DriverHandle)
{
NdisMDeregisterMiniportDriver(DriverHandle);
}
ParaNdis_DebugCleanup(pDriverObject);
#ifdef NETKVM_WPP_ENABLED
WPP_CLEANUP(pDriverObject);
Expand Down

0 comments on commit 9991311

Please sign in to comment.