tpmdd fixes for Linux v5.5-rc6 part 2

-----BEGIN PGP SIGNATURE-----
 
 iJYEABYIAD4WIQRE6pSOnaBC00OEHEIaerohdGur0gUCXhX/xyAcamFya2tvLnNh
 a2tpbmVuQGxpbnV4LmludGVsLmNvbQAKCRAaerohdGur0rWzAQCWBxqWAa9FCR+O
 UnoTOUKxAXKS2tZ9zaiIMPUkqHxvugEAjlMkcpMERDuHX40m1WyE6Q0mPaFXxLVp
 yc1Wc5dTNQw=
 =lKXu
 -----END PGP SIGNATURE-----

Merge tag 'tpmdd-next-20200108' of git://git.infradead.org/users/jjs/linux-tpmdd

Pull more tpmd fixes from Jarkko Sakkinen:
 "One critical regression fix (the faulty commit got merged in rc3, but
  also marked for stable)"

* tag 'tpmdd-next-20200108' of git://git.infradead.org/users/jjs/linux-tpmdd:
  tpm: Handle negative priv->response_len in tpm_common_read()
This commit is contained in:
Linus Torvalds 2020-01-08 09:26:33 -08:00
commit b07f636fca
2 changed files with 2 additions and 2 deletions

View file

@ -130,7 +130,7 @@ ssize_t tpm_common_read(struct file *file, char __user *buf,
priv->response_read = true;
ret_size = min_t(ssize_t, size, priv->response_length);
if (!ret_size) {
if (ret_size <= 0) {
priv->response_length = 0;
goto out;
}

View file

@ -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;