]> git.baikalelectronics.ru Git - kernel.git/commit
tpm.c: fix crash during device removal
authorRichard MUSIL <richard.musil@st.com>
Wed, 6 Feb 2008 09:37:02 +0000 (01:37 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 6 Feb 2008 18:41:04 +0000 (10:41 -0800)
commit0f21f49061693f6a2439638d972aff51463da2fc
treefe34a0db0cf9ee8194fda3c778a44d67e6c4b0a4
parentda2e39e77e9ac5552668d212ff917e388b5fe124
tpm.c: fix crash during device removal

The clean up procedure now uses platform device "release" callback to
handle memory clean up.  For this purpose "release" function callback was
added to struct tpm_vendor_specific, so hw device driver provider can get
called when it is safe to remove all allocated resources.

This is supposed to fix a bug in device removal, where device while in
receive function (waiting on timeout) was prone to segfault, if the
tpm_chip struct was unallocated before the timeout expired (in
tpm_remove_hardware).

Acked-by: Marcel Selhorst <tpm@selhorst.net>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/tpm/tpm.c
drivers/char/tpm/tpm.h