Skip to content

Commit

Permalink
Fixes for minor scan-build warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Apr 30, 2020
1 parent 6bd412d commit 5de30b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/wrap/wrap_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ int TPM2_Wrapper_Test(void* userCtx)

/* unload all transient handles */
rc = wolfTPM2_UnloadHandles_AllTransient(&dev);
if (rc != 0) goto exit;


/*------------------------------------------------------------------------*/
Expand Down Expand Up @@ -768,7 +769,6 @@ int TPM2_Wrapper_Test(void* userCtx)
}
else if (rc == TPM_RC_COMMAND_CODE) {
printf("Encrypt/Decrypt: Is not a supported feature due to export controls\n");
rc = TPM_RC_SUCCESS; /* clear error code */
}
else {
printf("Encrypt/Decrypt (gen key) test failed, result not as expected!\n");
Expand Down
5 changes: 3 additions & 2 deletions src/tpm2_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ static int wolfTPM2_Init_NoDev(TPM2_CTX* ctx, TPM2HalIoCb ioCb, void* userCtx,
#endif
return rc;
}
rc = TPM_RC_SUCCESS;
#ifdef DEBUG_WOLFTPM
printf("TPM2_Startup pass\n");
#endif
Expand All @@ -91,7 +90,9 @@ static int wolfTPM2_Init_NoDev(TPM2_CTX* ctx, TPM2HalIoCb ioCb, void* userCtx,
#ifdef DEBUG_WOLFTPM
printf("TPM2_SelfTest pass\n");
#endif
#endif
#else
rc = TPM_RC_SUCCESS;
#endif /* WOLFTPM_MCHP || WOLFTPM_PERFORM_SELFTEST */

return rc;
}
Expand Down

0 comments on commit 5de30b8

Please sign in to comment.