diff --git a/src/tss2-tcti/tcti-mssim.c b/src/tss2-tcti/tcti-mssim.c index a358452c6..5a83dbcbe 100644 --- a/src/tss2-tcti/tcti-mssim.c +++ b/src/tss2-tcti/tcti-mssim.c @@ -136,7 +136,7 @@ send_sim_session_end ( TSS2_RC rc; rc = Tss2_MU_UINT32_Marshal (TPM_SESSION_END, buf, sizeof (buf), NULL); - if (rc == TSS2_RC_SUCCESS) { + if (rc != TSS2_RC_SUCCESS) { return rc; } return socket_xmit_buf (sock, buf, sizeof (buf)); diff --git a/test/unit/tcti-mssim.c b/test/unit/tcti-mssim.c index c89149e7a..e32b4917a 100644 --- a/test/unit/tcti-mssim.c +++ b/test/unit/tcti-mssim.c @@ -336,6 +336,9 @@ tcti_socket_teardown (void **state) { TSS2_TCTI_CONTEXT *ctx = (TSS2_TCTI_CONTEXT*)*state; + will_return (__wrap_write, 4); + will_return (__wrap_write, 4); + Tss2_Tcti_Finalize (ctx); free (ctx); return 0; @@ -358,6 +361,7 @@ tcti_mssim_get_poll_handles_test (void **state) assert_int_equal (rc, TSS2_RC_SUCCESS); assert_int_equal (num_handles, 1); assert_int_equal (handles[0].fd, mssim_ctx->tpm_sock); + } /* */