Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reset tcti_common->state in tcti_device_receive when return TSS2_TCTI… #2929

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/tss2-tcti/tcti-device.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ tcti_device_receive (
if (rc_poll < 0) {
LOG_ERROR ("Failed to poll for response from fd %d, got errno %d: %s",
tcti_dev->fd, errno, strerror(errno));
return TSS2_TCTI_RC_IO_ERROR;
rc = TSS2_TCTI_RC_IO_ERROR;
goto out;
} else if (rc_poll == 0) {
LOG_INFO ("Poll timed out on fd %d.", tcti_dev->fd);
return TSS2_TCTI_RC_TRY_AGAIN;
Expand All @@ -195,7 +196,8 @@ tcti_device_receive (
if (size < 0 || size != TPM_HEADER_SIZE) {
LOG_ERROR ("Failed to get response size fd %d, got errno %d: %s",
tcti_dev->fd, errno, strerror (errno));
return TSS2_TCTI_RC_IO_ERROR;
rc = TSS2_TCTI_RC_IO_ERROR;
goto out;
}
} else {
LOG_ERROR ("Header could not be received");
Expand Down Expand Up @@ -246,7 +248,8 @@ tcti_device_receive (
if (rc_poll < 0) {
LOG_ERROR ("Failed to poll for response from fd %d, got errno %d: %s",
tcti_dev->fd, errno, strerror (errno));
return TSS2_TCTI_RC_IO_ERROR;
rc = TSS2_TCTI_RC_IO_ERROR;
goto out;
} else if (rc_poll == 0) {
LOG_INFO ("Poll timed out on fd %d.", tcti_dev->fd);
return TSS2_TCTI_RC_TRY_AGAIN;
Expand All @@ -262,7 +265,8 @@ tcti_device_receive (
if (size < 0) {
LOG_ERROR ("Failed to read response from fd %d, got errno %d: %s",
tcti_dev->fd, errno, strerror (errno));
return TSS2_TCTI_RC_IO_ERROR;
rc = TSS2_TCTI_RC_IO_ERROR;
goto out;
}
}
if (size == 0) {
Expand Down