|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 1/4] gnttab: Don't free resources through an ASSERT
ASSERT macros skip evaluating their contents, so calling e.g.
RevokeForeignAccess inside an ASSERT will end up causing the call to be
skipped in release builds.
Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
src/xeniface/ioctl_gnttab.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/xeniface/ioctl_gnttab.c b/src/xeniface/ioctl_gnttab.c
index b903387..b5f2ce9 100644
--- a/src/xeniface/ioctl_gnttab.c
+++ b/src/xeniface/ioctl_gnttab.c
@@ -153,13 +153,16 @@ GnttabStopSharing(
_In_ ULONG NumberPages
)
{
+ NTSTATUS status;
+
if (Context->Grants != NULL) {
for (ULONG Page = 0; Page < NumberPages; Page++) {
- ASSERT(NT_SUCCESS(XENBUS_GNTTAB(RevokeForeignAccess,
- &Fdo->GnttabInterface,
- Fdo->GnttabCache,
- FALSE,
- Context->Grants[Page])));
+ status = XENBUS_GNTTAB(RevokeForeignAccess,
+ &Fdo->GnttabInterface,
+ Fdo->GnttabCache,
+ FALSE,
+ Context->Grants[Page]);
+ ASSERT(NT_SUCCESS(status));
}
RtlZeroMemory(Context->Grants, Context->NumberPages *
sizeof(Context->Grants[0]));
@@ -794,10 +797,9 @@ fail11:
fail10:
Error("Fail10\n");
- ASSERT(NT_SUCCESS(XENBUS_GNTTAB(UnmapForeignPages,
- &Fdo->GnttabInterface,
- Context->Address
- )));
+ XENBUS_GNTTAB(UnmapForeignPages,
+ &Fdo->GnttabInterface,
+ Context->Address);
fail9:
Error("Fail9\n");
--
2.55.0.windows.3
--
Ngoc Tu Dinh | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |