mirror of
https://github.com/reactos/reactos.git
synced 2024-09-15 07:05:04 +00:00
- Initially set PoolHandle, ConfigurationHandle, KeyHandle, and Filter to NULL
- Initially set PortOffset to 0 - Fix 4 memory leaks - Remove a useless if svn path=/branches/aicom-network-fixes/; revision=35848
This commit is contained in:
parent
954aed91f2
commit
1443f6833b
|
@ -488,6 +488,8 @@ NdisAllocatePacketPoolEx(
|
||||||
"NumberOfDescriptors (%d) ProtocolReservedLength (%d).\n",
|
"NumberOfDescriptors (%d) ProtocolReservedLength (%d).\n",
|
||||||
Status, PoolHandle, NumberOfDescriptors, ProtocolReservedLength));
|
Status, PoolHandle, NumberOfDescriptors, ProtocolReservedLength));
|
||||||
|
|
||||||
|
*PoolHandle = NULL;
|
||||||
|
|
||||||
if (NumberOfDescriptors > 0xffff)
|
if (NumberOfDescriptors > 0xffff)
|
||||||
{
|
{
|
||||||
*Status = NDIS_STATUS_RESOURCES;
|
*Status = NDIS_STATUS_RESOURCES;
|
||||||
|
@ -528,8 +530,9 @@ NdisAllocatePacketPoolEx(
|
||||||
|
|
||||||
*Status = NDIS_STATUS_SUCCESS;
|
*Status = NDIS_STATUS_SUCCESS;
|
||||||
*PoolHandle = (PNDIS_HANDLE)Pool;
|
*PoolHandle = (PNDIS_HANDLE)Pool;
|
||||||
} else
|
} else {
|
||||||
*Status = NDIS_STATUS_RESOURCES;
|
*Status = NDIS_STATUS_RESOURCES;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -193,13 +193,14 @@ NdisOpenConfiguration(
|
||||||
|
|
||||||
NDIS_DbgPrint(MAX_TRACE, ("Called\n"));
|
NDIS_DbgPrint(MAX_TRACE, ("Called\n"));
|
||||||
|
|
||||||
|
*ConfigurationHandle = NULL;
|
||||||
|
|
||||||
*Status = ZwDuplicateObject(NtCurrentProcess(), RootKeyHandle,
|
*Status = ZwDuplicateObject(NtCurrentProcess(), RootKeyHandle,
|
||||||
NtCurrentProcess(), &KeyHandle, 0, 0,
|
NtCurrentProcess(), &KeyHandle, 0, 0,
|
||||||
DUPLICATE_SAME_ACCESS);
|
DUPLICATE_SAME_ACCESS);
|
||||||
if(!NT_SUCCESS(*Status))
|
if(!NT_SUCCESS(*Status))
|
||||||
{
|
{
|
||||||
NDIS_DbgPrint(MID_TRACE, ("Failed to open registry configuration for this miniport\n"));
|
NDIS_DbgPrint(MID_TRACE, ("Failed to open registry configuration for this miniport\n"));
|
||||||
*ConfigurationHandle = NULL;
|
|
||||||
*Status = NDIS_STATUS_FAILURE;
|
*Status = NDIS_STATUS_FAILURE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -743,7 +744,8 @@ NdisReadNetworkAddress(
|
||||||
if(!MiniportResource)
|
if(!MiniportResource)
|
||||||
{
|
{
|
||||||
NDIS_DbgPrint(MIN_TRACE,("Insufficient resources.\n"));
|
NDIS_DbgPrint(MIN_TRACE,("Insufficient resources.\n"));
|
||||||
*Status = NDIS_STATUS_FAILURE;
|
ExFreePool(IntArray);
|
||||||
|
*Status = NDIS_STATUS_RESOURCES;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -797,6 +799,8 @@ NdisOpenConfigurationKeyByIndex(
|
||||||
NDIS_HANDLE RegKeyHandle;
|
NDIS_HANDLE RegKeyHandle;
|
||||||
PMINIPORT_CONFIGURATION_CONTEXT ConfigurationContext;
|
PMINIPORT_CONFIGURATION_CONTEXT ConfigurationContext;
|
||||||
|
|
||||||
|
*KeyHandle = NULL;
|
||||||
|
|
||||||
*Status = ZwEnumerateKey(ConfigurationHandle, Index, KeyBasicInformation, NULL, 0, &KeyInformationLength);
|
*Status = ZwEnumerateKey(ConfigurationHandle, Index, KeyBasicInformation, NULL, 0, &KeyInformationLength);
|
||||||
if(*Status != STATUS_BUFFER_TOO_SMALL && *Status != STATUS_BUFFER_OVERFLOW && *Status != STATUS_SUCCESS)
|
if(*Status != STATUS_BUFFER_TOO_SMALL && *Status != STATUS_BUFFER_OVERFLOW && *Status != STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
|
@ -885,6 +889,8 @@ NdisOpenConfigurationKeyByName(
|
||||||
OBJECT_ATTRIBUTES KeyAttributes;
|
OBJECT_ATTRIBUTES KeyAttributes;
|
||||||
NDIS_HANDLE RegKeyHandle;
|
NDIS_HANDLE RegKeyHandle;
|
||||||
|
|
||||||
|
*KeyHandle = NULL;
|
||||||
|
|
||||||
InitializeObjectAttributes(&KeyAttributes, KeyName, OBJ_CASE_INSENSITIVE, ConfigurationHandle, 0);
|
InitializeObjectAttributes(&KeyAttributes, KeyName, OBJ_CASE_INSENSITIVE, ConfigurationHandle, 0);
|
||||||
*Status = ZwOpenKey(&RegKeyHandle, KEY_ALL_ACCESS, &KeyAttributes);
|
*Status = ZwOpenKey(&RegKeyHandle, KEY_ALL_ACCESS, &KeyAttributes);
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ EthCreateFilter(
|
||||||
*Filter = (PETH_FILTER)NewFilter;
|
*Filter = (PETH_FILTER)NewFilter;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
*Filter = NULL;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -841,6 +841,8 @@ NdisMRegisterIoPortRange(
|
||||||
PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle;
|
PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle;
|
||||||
ULONG AddressSpace = 1; /* FIXME The HAL handles this wrong atm */
|
ULONG AddressSpace = 1; /* FIXME The HAL handles this wrong atm */
|
||||||
|
|
||||||
|
*PortOffset = 0;
|
||||||
|
|
||||||
NDIS_DbgPrint(MAX_TRACE, ("Called - InitialPort 0x%x, NumberOfPorts 0x%x\n", InitialPort, NumberOfPorts));
|
NDIS_DbgPrint(MAX_TRACE, ("Called - InitialPort 0x%x, NumberOfPorts 0x%x\n", InitialPort, NumberOfPorts));
|
||||||
|
|
||||||
memset(&PortAddress, 0, sizeof(PortAddress));
|
memset(&PortAddress, 0, sizeof(PortAddress));
|
||||||
|
@ -878,7 +880,6 @@ NdisMRegisterIoPortRange(
|
||||||
|
|
||||||
NDIS_DbgPrint(MAX_TRACE, ("calling MmMapIoSpace\n"));
|
NDIS_DbgPrint(MAX_TRACE, ("calling MmMapIoSpace\n"));
|
||||||
|
|
||||||
*PortOffset = 0;
|
|
||||||
*PortOffset = MmMapIoSpace(TranslatedAddress, NumberOfPorts, MmNonCached);
|
*PortOffset = MmMapIoSpace(TranslatedAddress, NumberOfPorts, MmNonCached);
|
||||||
NDIS_DbgPrint(MAX_TRACE, ("Returning 0x%x for port range\n", *PortOffset));
|
NDIS_DbgPrint(MAX_TRACE, ("Returning 0x%x for port range\n", *PortOffset));
|
||||||
|
|
||||||
|
|
|
@ -562,13 +562,6 @@ MiniQueryInformation(
|
||||||
|
|
||||||
/* FIXME: Wait in pending case! */
|
/* FIXME: Wait in pending case! */
|
||||||
|
|
||||||
/* XXX is status_pending part of success macro? */
|
|
||||||
if ((NT_SUCCESS(NdisStatus)) || (NdisStatus == NDIS_STATUS_PENDING))
|
|
||||||
{
|
|
||||||
NDIS_DbgPrint(DEBUG_MINIPORT, ("Miniport returned status (0x%X).\n", NdisStatus));
|
|
||||||
return NdisStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NdisStatus;
|
return NdisStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1017,6 +1010,7 @@ NdisInitializeWrapper(
|
||||||
RegistryPath = ExAllocatePool(PagedPool, sizeof(UNICODE_STRING));
|
RegistryPath = ExAllocatePool(PagedPool, sizeof(UNICODE_STRING));
|
||||||
if(!RegistryPath)
|
if(!RegistryPath)
|
||||||
{
|
{
|
||||||
|
ExFreePool(Miniport);
|
||||||
NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
|
NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1028,6 +1022,8 @@ NdisInitializeWrapper(
|
||||||
if(!RegistryBuffer)
|
if(!RegistryBuffer)
|
||||||
{
|
{
|
||||||
NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
|
NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
|
||||||
|
ExFreePool(Miniport);
|
||||||
|
ExFreePool(RegistryPath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue