diff options
author | Tadeusz Struk <tadeusz.struk@intel.com> | 2020-01-08 01:04:48 +0300 |
---|---|---|
committer | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 2020-01-08 19:11:09 +0300 |
commit | a430e67d9a2c62a8c7b315b99e74de02018d0a96 (patch) | |
tree | 70711c264122f4a563d9b27360f5fa5411dd28c2 /drivers/char/tpm/tpm-dev.h | |
parent | ae6088216ce4b99b3a4aaaccd2eb2dd40d473d42 (diff) | |
download | linux-a430e67d9a2c62a8c7b315b99e74de02018d0a96.tar.xz |
tpm: Handle negative priv->response_len in tpm_common_read()
The priv->response_length can hold the size of an response or an negative
error code, and the tpm_common_read() needs to handle both cases correctly.
Changed the type of response_length to signed and accounted for negative
value in tpm_common_read().
Cc: stable@vger.kernel.org
Fixes: d23d12484307 ("tpm: fix invalid locking in NONBLOCKING mode")
Reported-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Diffstat (limited to 'drivers/char/tpm/tpm-dev.h')
-rw-r--r-- | drivers/char/tpm/tpm-dev.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm-dev.h b/drivers/char/tpm/tpm-dev.h index 1089fc0bb290..f3742bcc73e3 100644 --- a/drivers/char/tpm/tpm-dev.h +++ b/drivers/char/tpm/tpm-dev.h @@ -14,7 +14,7 @@ struct file_priv { struct work_struct timeout_work; struct work_struct async_work; wait_queue_head_t async_wait; - size_t response_length; + ssize_t response_length; bool response_read; bool command_enqueued; |