Blame SOURCES/0001-tpm2_hierarchycontrol-Fixed-bug-where-hierarchycontr.patch

ec8dc5
From 334b4c739fa575fb4ea58f92df6de87c38e59e15 Mon Sep 17 00:00:00 2001
ec8dc5
From: Imran Desai <imran.desai@intel.com>
ec8dc5
Date: Thu, 23 Jan 2020 08:06:56 -0700
ec8dc5
Subject: [PATCH] tpm2_hierarchycontrol: Fixed bug where hierarchycontrol
ec8dc5
 operation failed silently
ec8dc5
ec8dc5
Fixes #1841
ec8dc5
ec8dc5
Signed-off-by: Imran Desai <imran.desai@intel.com>
ec8dc5
---
ec8dc5
 tools/tpm2_hierarchycontrol.c | 10 ++++++++--
ec8dc5
 1 file changed, 8 insertions(+), 2 deletions(-)
ec8dc5
ec8dc5
diff --git a/tools/tpm2_hierarchycontrol.c b/tools/tpm2_hierarchycontrol.c
ec8dc5
index 0baf2ca487d3..7e9e2c657544 100644
ec8dc5
--- a/tools/tpm2_hierarchycontrol.c
ec8dc5
+++ b/tools/tpm2_hierarchycontrol.c
ec8dc5
@@ -32,8 +32,14 @@ static tool_rc hierarchycontrol(ESYS_CONTEXT *ectx) {
ec8dc5
         ctx.enable == TPM2_RH_ENDORSEMENT ? "ehEnable" : "phEnableNV",
ec8dc5
         ctx.state ? "SET" : "CLEAR");
ec8dc5
 
ec8dc5
-    return tpm2_hierarchycontrol(ectx, &ctx.auth_hierarchy.object, ctx.enable,
ec8dc5
-            ctx.state);
ec8dc5
+    tool_rc rc = tpm2_hierarchycontrol(ectx, &ctx.auth_hierarchy.object,
ec8dc5
+        ctx.enable, ctx.state);
ec8dc5
+
ec8dc5
+    if (rc != tool_rc_success) {
ec8dc5
+        LOG_ERR("Failed hierarchycontrol operation.");
ec8dc5
+    }
ec8dc5
+
ec8dc5
+    return rc;
ec8dc5
 }
ec8dc5
 
ec8dc5
 bool on_arg(int argc, char **argv) {
ec8dc5
-- 
ec8dc5
2.27.0
ec8dc5