[PATCH -next] KEYS: trusted: remove set but not used variable ''

YueHaibing yuehaibing at huawei.com
Thu Oct 11 07:06:39 UTC 2018


Fixes gcc '-Wunused-but-set-variable' warning:

security/keys/trusted.c: In function 'tpm_unseal':
security/keys/trusted.c:592:11: warning:
 variable 'keyhndl' set but not used [-Wunused-but-set-variable]
  uint32_t keyhndl;

It never used since introduction in 
commit d00a1c72f7f4 ("keys: add new trusted key-type")

Signed-off-by: YueHaibing <yuehaibing at huawei.com>
---
 security/keys/trusted.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/security/keys/trusted.c b/security/keys/trusted.c
index ff67893..169df79 100644
--- a/security/keys/trusted.c
+++ b/security/keys/trusted.c
@@ -589,7 +589,6 @@ static int tpm_unseal(struct tpm_buf *tb,
 	uint32_t authhandle2 = 0;
 	unsigned char cont = 0;
 	uint32_t ordinal;
-	uint32_t keyhndl;
 	int ret;
 
 	/* sessions for unsealing key and data */
@@ -605,7 +604,6 @@ static int tpm_unseal(struct tpm_buf *tb,
 	}
 
 	ordinal = htonl(TPM_ORD_UNSEAL);
-	keyhndl = htonl(SRKHANDLE);
 	ret = tpm_get_random(NULL, nonceodd, TPM_NONCE_SIZE);
 	if (ret != TPM_NONCE_SIZE) {
 		pr_info("trusted_key: tpm_get_random failed (%d)\n", ret);



More information about the Linux-security-module-archive mailing list