tpm: Check the bios_dir entry for NULL before accessing it
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Wed, 16 Nov 2016 13:56:13 +0000 (08:56 -0500)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Sun, 27 Nov 2016 23:31:32 +0000 (01:31 +0200)
commit005451d44ad46623aac8349df15d7c0d1d8914c1
tree517a6c33f47e181253b35bb61772cf01891ce084
parent79eec5b940cffff14c7bd1b9eb856ccb36274cc2
tpm: Check the bios_dir entry for NULL before accessing it

Check the bios_dir entry for NULL before accessing it. Currently
this crashes the driver when a TPM 2 is attached and the entries
are NULL.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/tpm_eventlog.c