tpm: add check after commands attribs tab allocation
authorTadeusz Struk <tadeusz.struk@intel.com>
Mon, 7 Oct 2019 21:46:37 +0000 (14:46 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2019 19:07:19 +0000 (20:07 +0100)
commitfc9f2ccc279af2ee56972fa766d98e0905027ded
tree854a312286a74c4546e6d2cfd5715bcec9f05b32
parent0abe8cb6f92f4409442f1f6cd34d03e3895a76cc
tpm: add check after commands attribs tab allocation

commit f1689114acc5e89a196fec6d732dae3e48edb6ad upstream.

devm_kcalloc() can fail and return NULL so we need to check for that.

Cc: stable@vger.kernel.org
Fixes: 58472f5cd4f6f ("tpm: validate TPM 2.0 commands")
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/tpm/tpm2-cmd.c