diff --git a/daemon/upcall.c b/daemon/upcall.c index 62b7c4d..cea824a 100644 --- a/daemon/upcall.c +++ b/daemon/upcall.c @@ -99,12 +99,8 @@ int upcall_parse( if (status) goto out; status = safe_read(&buffer, &length, &upcall->root_ref, sizeof(HANDLE)); if (status) goto out; - if (upcall->root_ref != INVALID_HANDLE_VALUE) - nfs41_root_ref(upcall->root_ref); status = safe_read(&buffer, &length, &upcall->state_ref, sizeof(HANDLE)); if (status) goto out; - if (upcall->state_ref != INVALID_HANDLE_VALUE) - nfs41_open_state_ref(upcall->state_ref); dprintf(2, "version=%d xid=%d opcode=%s session=0x%x open_state=0x%x\n", version, upcall->xid, opcode2string(upcall->opcode), upcall->root_ref, @@ -114,6 +110,10 @@ int upcall_parse( upcall->status = status = NFSD_VERSION_MISMATCH; goto out; } + if (upcall->root_ref != INVALID_HANDLE_VALUE) + nfs41_root_ref(upcall->root_ref); + if (upcall->state_ref != INVALID_HANDLE_VALUE) + nfs41_open_state_ref(upcall->state_ref); if (upcall->opcode >= g_upcall_op_table_size) { status = ERROR_NOT_SUPPORTED;