From 23787cbeb21ff339f208bb30b4e82087555004a3 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 7 Sep 2008 19:38:21 +0000 Subject: [PATCH] - Make sure we successfully allocated memory svn path=/branches/aicom-network-fixes/; revision=36042 --- drivers/network/tcpip/datalink/lan.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/network/tcpip/datalink/lan.c b/drivers/network/tcpip/datalink/lan.c index a26e8d4e864..675506fae2f 100644 --- a/drivers/network/tcpip/datalink/lan.c +++ b/drivers/network/tcpip/datalink/lan.c @@ -861,6 +861,11 @@ static NTSTATUS FindDeviceDescForAdapter( PUNICODE_STRING Name, ExFreePool( Kbio ); KbioLength = ResultLength; Kbio = ExAllocatePool( NonPagedPool, KbioLength ); + if( !Kbio ) { + TI_DbgPrint(DEBUG_DATALINK,("Failed to allocate memory\n")); + NtClose( EnumKey ); + return STATUS_NO_MEMORY; + } Status = ZwEnumerateKey( EnumKey, i, KeyBasicInformation, Kbio, KbioLength, &ResultLength );