tpm: fix panic caused by "tpm: Autodetect itpm devices"
authorOlof Johansson <olof@lixom.net>
Fri, 7 Jan 2011 03:24:01 +0000 (21:24 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Feb 2011 23:15:00 +0000 (15:15 -0800)
commit719ab9fc03934405d9342239b956b42c1d6a8b9f
treeb1c9f7ebc2f032df86061ef0aca2d5ae8e326f5a
parent468f3e11a872a4f83009e5128e0a3c0e287a5633
tpm: fix panic caused by "tpm: Autodetect itpm devices"

commit e5cce6c13c25d9ac56955a3ae2fd562719848172 upstream.

commit 3f0d3d016d89a5efb8b926d4707eb21fa13f3d27 adds a check for
PNP device id to the common tpm_tis_init() function, which in some
cases (force=1) will be called without the device being a member of
a pnp_dev. Oopsing and panics ensue.

Move the test up to before the call to tpm_tis_init(), since it
just modifies a global variable anyway.

Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/char/tpm/tpm_tis.c