From b9e3238aa36db33aa0d0bd44ef85297c45627aac Mon Sep 17 00:00:00 2001 From: Rajiv Andrade Date: Tue, 1 Nov 2011 17:00:52 -0200 Subject: TPM: fix transmit_cmd error logic It's incorrect to assume that buffers returned by the TPM 10 bytes long are always error reports. This patches parses the error field in its header instead. The error report is now being printed using dev_err() instead of dev_dbg(), making it easier for users to provide more detailed bug reports. Signed-off-by: Rajiv Andrade --- drivers/char/tpm/tpm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/char/tpm/tpm.h') diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index 9deb65c0ab61..8c1df302fbb6 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h @@ -39,7 +39,7 @@ enum tpm_addr { }; #define TPM_WARN_DOING_SELFTEST 0x802 - +#define TPM_HEADER_SIZE 10 extern ssize_t tpm_show_pubek(struct device *, struct device_attribute *attr, char *); extern ssize_t tpm_show_pcrs(struct device *, struct device_attribute *attr, -- cgit v1.2.3