From f6123215715b168bddce7ae4cf968b358df9baf1 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 12 Oct 2010 09:44:55 -0400 Subject: [PATCH] mount: use NULL to indicate no existing session was previously setting pNetRootContext->session to INVALID_HANDLE_VALUE on error, and required checking for both that and NULL. since it starts initialized to NULL, keep it that way Signed-off-by: Casey Bodley --- sys/nfs41_driver.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c index aa0295a..1ee0096 100644 --- a/sys/nfs41_driver.c +++ b/sys/nfs41_driver.c @@ -2229,7 +2229,7 @@ NTSTATUS nfs41_CreateVNetRoot( goto out; DbgP("Server Name %wZ Mount Point %wZ\n", &pVNetRootContext->Config.SrvName, &pVNetRootContext->Config.MntPt); - pVNetRootContext->session = pNetRootContext->session = INVALID_HANDLE_VALUE; + pVNetRootContext->session = pNetRootContext->session = NULL; status = nfs41_mount(&pVNetRootContext->Config.SrvName, &pVNetRootContext->Config.MntPt, &pVNetRootContext->session); if (status == STATUS_SUCCESS) @@ -2240,7 +2240,7 @@ NTSTATUS nfs41_CreateVNetRoot( if (pNetRootContext->session == NULL) { DbgP("We dont have a valid existing session and we don't have a mount point!\n"); status = STATUS_UNEXPECTED_NETWORK_ERROR; - pNetRootContext->session = INVALID_HANDLE_VALUE; + pNetRootContext->session = NULL; goto out; } RtlCopyMemory(&pVNetRootContext->Config, &pNetRootContext->Config, @@ -2344,8 +2344,7 @@ NTSTATUS nfs41_FinalizeNetRoot( goto out; } - if (pNetRootContext == NULL || pNetRootContext->session == INVALID_HANDLE_VALUE || - pNetRootContext->session == NULL) { + if (pNetRootContext == NULL || pNetRootContext->session == NULL) { DbgP("No valid session has been established\n"); goto out; } @@ -2517,7 +2516,7 @@ NTSTATUS nfs41_Create( goto out; } - if (pNetRootContext->session == INVALID_HANDLE_VALUE) { + if (pNetRootContext->session == NULL) { DbgP("No valid session established\n"); goto out; }