Skip to content
Commit 12c289a1 authored by Tadeusz Struk's avatar Tadeusz Struk Committed by Paul Gortmaker
Browse files

tpm: fix invalid locking in NONBLOCKING mode

commit d23d1248 upstream.

When an application sends TPM commands in NONBLOCKING mode
the driver holds chip->tpm_mutex returning from write(),
which triggers: "WARNING: lock held when returning to user space".
To fix this issue the driver needs to release the mutex before
returning and acquire it again in tpm_dev_async_work() before
sending the command.

Cc: stable@vger.kernel.org
Fixes: 9e1b74a6

 (tpm: add support for nonblocking operation)
Reported-by: default avatarJeffrin Jose T <jeffrin@rajagiritech.edu.in>
Tested-by: default avatarJeffrin Jose T <jeffrin@rajagiritech.edu.in>
Signed-off-by: default avatarTadeusz Struk <tadeusz.struk@intel.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent f138d273
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment