|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH] Fix ASSERT failures in error paths
* StorePrepareRequest can fail if a non-NULL transaction is passed.
Check the return value where a transaction is passed to StorePrepareRequest
* StoreSubmitRequest should zero the request if it fails.
Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
src/xenbus/store.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/xenbus/store.c b/src/xenbus/store.c
index 5ffea1f..778414c 100644
--- a/src/xenbus/store.c
+++ b/src/xenbus/store.c
@@ -966,6 +966,8 @@ StoreSubmitRequest(
fail1:
Error("fail1 (%08x)\n", status);
+ RtlZeroMemory(Request, sizeof (XENBUS_STORE_REQUEST));
+
return NULL;
}
@@ -1571,17 +1573,18 @@ StoreTransactionEnd(
XS_TRANSACTION_END,
(Commit) ? "T" : "F", 2,
NULL, 0);
- ASSERT(NT_SUCCESS(status));
+ if (!NT_SUCCESS(status))
+ goto fail1;
Response = StoreSubmitRequest(Context, &Request);
status = STATUS_NO_MEMORY;
if (Response == NULL)
- goto fail1;
+ goto fail2;
status = StoreCheckResponse(Response);
if (!NT_SUCCESS(status) && status != STATUS_RETRY)
- goto fail2;
+ goto fail3;
StoreFreeResponse(Response);
ASSERT(IsZeroMemory(&Request, sizeof (XENBUS_STORE_REQUEST)));
@@ -1605,11 +1608,13 @@ done:
return status;
-fail2:
+fail3:
ASSERT3U(status, !=, STATUS_RETRY);
StoreFreeResponse(Response);
+fail2:
+
fail1:
ASSERT(IsZeroMemory(&Request, sizeof (XENBUS_STORE_REQUEST)));
--
2.39.0.windows.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |