From bfe06cbfca79ba0275ce2eea3a328e26fd1598a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Bi=C8=99oc?= Date: Fri, 30 Dec 2022 19:47:21 +0100 Subject: [PATCH] [SDK][CMLIB] Properly check for failure if hive free list creation fails HvpCreateHiveFreeCellList returns a NTSTATUS code yet the way the code path checks checks for failure is just wrong. This was spotted whilst working on #4571 PR. --- sdk/lib/cmlib/hiveinit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/lib/cmlib/hiveinit.c b/sdk/lib/cmlib/hiveinit.c index 2b070fb4f7e..3eee62d149e 100644 --- a/sdk/lib/cmlib/hiveinit.c +++ b/sdk/lib/cmlib/hiveinit.c @@ -306,7 +306,7 @@ HvpInitializeMemoryHive( BlockIndex += Bin->Size / HBLOCK_SIZE; } - if (HvpCreateHiveFreeCellList(Hive)) + if (!NT_SUCCESS(HvpCreateHiveFreeCellList(Hive))) { HvpFreeHiveBins(Hive); Hive->Free(Hive->BaseBlock, Hive->BaseBlockAlloc);