CHROMIUM: tpm: fix potential deadlock in resume_if_needed
authorGrant Grundler <grundler@chromium.org>
Sat, 12 May 2012 00:16:27 +0000 (00:16 +0000)
committerOlof Johansson <olof@lixom.net>
Fri, 1 Jun 2012 06:55:17 +0000 (23:55 -0700)
commitbba7c55eb4babfa617799a36a7fc38bb8d5b6744
treedf2378d3a9e23e5b41f20bb7e1dd34ed8e5c87b9
parent9e897183d50b3cc0d85aaee2cf526e12c88be95e
CHROMIUM: tpm: fix potential deadlock in resume_if_needed

Fixes potential deadlock in this call sequence:
    transmit_cmd -> resume_if_needed -> tpm_continue_selftest -> transmit_cmd

Sequence is now:
    transmit_cmd -> resume_if_needed -> tpm_continue_selftest -> tpm_transmit

Reorders declarations of transmit_cmd, tpm_continue_selftest, etc so
we don't need forward declarations of functions.

BUG=none
TEST=code review found the issue. No test.

Change-Id: I95aeb69e89faa2a6c6491350e49bd46ac44f06b1
Signed-off-by: Grant Grundler <grundler@chromium.org>
drivers/char/tpm/tpm.c