From: Miquel Raynal Date: Tue, 15 May 2018 09:57:11 +0000 (+0200) Subject: tpm: report driver error code to upper layer X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=bcdf6b9f26fe9cd452f5f309a6e410ea4513e60b;p=u-boot.git tpm: report driver error code to upper layer 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 Reviewed-by: Simon Glass Reviewed-by: Tom Rini --- diff --git a/lib/tpm-common.c b/lib/tpm-common.c index 33fa85926c..43b530865a 100644 --- a/lib/tpm-common.c +++ b/lib/tpm-common.c @@ -169,7 +169,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;