[coreboot-gerrit] Change in coreboot[master]: security/tpm/tss/tcg-2.0/tss_marshaling.c: Avoid static analysis error

Richard Spiegel (Code Review) gerrit at coreboot.org
Tue Aug 7 18:24:48 CEST 2018


Richard Spiegel has uploaded this change for review. ( https://review.coreboot.org/27931


Change subject: security/tpm/tss/tcg-2.0/tss_marshaling.c: Avoid static analysis error
......................................................................

security/tpm/tss/tcg-2.0/tss_marshaling.c: Avoid static analysis error

In procedure tpm_unmarshal_response(), variable "rc" is used early to
decide if it should return NULL. However, from that point on, the variable
is only |=, but not read. Thus it's causing a static analysis error. Add a
printk line using variable "rc" to avoid static analysis error.

BUG=b:112253891
TEST=Build and boot grunt.

Change-Id: I7575bc75104fd97f138224aa57561e68f6548e58
Signed-off-by: Richard Spiegel <richard.spiegel at silverbackltd.com>
---
M src/security/tpm/tss/tcg-2.0/tss_marshaling.c
1 file changed, 3 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/27931/1

diff --git a/src/security/tpm/tss/tcg-2.0/tss_marshaling.c b/src/security/tpm/tss/tcg-2.0/tss_marshaling.c
index 86f2231..bd46a7c 100644
--- a/src/security/tpm/tss/tcg-2.0/tss_marshaling.c
+++ b/src/security/tpm/tss/tcg-2.0/tss_marshaling.c
@@ -554,6 +554,9 @@
 		       command, ibuf_remaining(ib));
 		return NULL;
 	}
+	if (rc)
+		printk(BIOS_INFO, "Final tpm_unmarshal_response status 0x%x\n",
+				rc);
 
 	/* The entire message have been parsed. */
 	return tpm2_resp;

-- 
To view, visit https://review.coreboot.org/27931
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7575bc75104fd97f138224aa57561e68f6548e58
Gerrit-Change-Number: 27931
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Spiegel <richard.spiegel at silverbackltd.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180807/4ab25b1c/attachment-0001.html>


More information about the coreboot-gerrit mailing list