[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 2/2] xenbus/cache: spill slabs on CacheFill failure to prevent pool leak


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: david ambu <david.preetham@xxxxxxxxxx>
  • Date: Mon, 14 Sep 2026 14:14:05 +0100
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
  • Cc: david ambu <david.preetham@xxxxxxxxxx>
  • Delivery-date: Mon, 14 Sep 2026 13:14:50 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Move CacheSpill from fail5 to fail4 in CacheFill so that all failure
paths release allocated slabs via fall-through, preventing a
NonPagedPool leak. The duplicate CacheSpill at fail5 is removed since
fail5 falls through to fail4 where the single call now handles both
cases.

Assisted-by: ClaudeCode:claude-sonnet-4-6
Signed-off-by: david ambu <david.preetham@xxxxxxxxxx>
---
 src/xenbus/cache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/xenbus/cache.c b/src/xenbus/cache.c
index 90aea08..ae72464 100644
--- a/src/xenbus/cache.c
+++ b/src/xenbus/cache.c
@@ -901,11 +901,11 @@ fail5:
 
     (*Cache)->MagazineCount = 0;
 
-    CacheSpill(*Cache, 0);
-
 fail4:
     Error("fail4\n");
 
+    CacheSpill(*Cache, 0);
+
 fail3:
     Error("fail3\n");
 
-- 
2.51.0.windows.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.