Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: firmware/stub/tpm_lite_stub.c

Issue 5796005: vboot TPM stub functions return error codes (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « firmware/lib/tpm_lite/tlcl.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/stub/tpm_lite_stub.c
diff --git a/firmware/stub/tpm_lite_stub.c b/firmware/stub/tpm_lite_stub.c
index 2695fae35d7136bec9a0d5ee080577588b52e6eb..57ef03ad9c9a0bf25137f719228f55964ff8332d 100644
--- a/firmware/stub/tpm_lite_stub.c
+++ b/firmware/stub/tpm_lite_stub.c
@@ -99,22 +99,23 @@ POSSIBLY_UNUSED static INLINE int TpmResponseSize(const uint8_t* buffer) {
}
-void TlclStubInit(void) {
- TlclOpenDevice();
+uint32_t TlclStubInit(void) {
+ return TlclOpenDevice();
}
-void TlclCloseDevice(void) {
+uint32_t TlclCloseDevice(void) {
close(tpm_fd);
Randall Spangler 2010/12/14 18:12:28 if (tpm_fd != -1) close(tpm_fd); (don't close i
Che-Liang Chiou 2010/12/15 03:04:37 Done.
tpm_fd = -1;
+ return 0;
}
-void TlclOpenDevice(void) {
+uint32_t TlclOpenDevice(void) {
char* device_path;
if (tpm_fd >= 0)
- return; /* Already open */
+ return 0; /* Already open */
device_path = getenv("TPM_DEVICE_PATH");
if (device_path == NULL) {
@@ -124,7 +125,10 @@ void TlclOpenDevice(void) {
tpm_fd = open(device_path, O_RDWR);
if (tpm_fd < 0) {
error("cannot open TPM device %s: %s\n", device_path, strerror(errno));
+ return TPM_E_IOERROR;
}
+
+ return 0;
}
« no previous file with comments | « firmware/lib/tpm_lite/tlcl.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698