[U-Boot] [PATCH v3 07/25] tpm: report driver error code to upper layer

Miquel Raynal miquel.raynal at bootlin.com
Wed May 2 08:59:16 UTC 2018


Instead of returning a generic 'library' error, report back the actual
error code so it can be displayed to the user by the regular error path.

Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
---
 lib/tpm-common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/tpm-common.c b/lib/tpm-common.c
index 57832debf3..08e2c2ad44 100644
--- a/lib/tpm-common.c
+++ b/lib/tpm-common.c
@@ -170,7 +170,8 @@ u32 tpm_sendrecv_command(const void *command, void *response, size_t *size_ptr)
 		       response, &response_length);
 
 	if (err < 0)
-		return TPM_LIB_ERROR;
+		return err;
+
 	if (size_ptr)
 		*size_ptr = response_length;
 
-- 
2.14.1



More information about the U-Boot mailing list