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)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tue, 12 Nov 2019 19:45:37 +0000 (21:45 +0200)
commitf1689114acc5e89a196fec6d732dae3e48edb6ad
treeacebb07fcaf593a6a17bd6973d5307ddda5d1441
parent1fce4d8a19fe3e49157327e7db1611269cd49d10
tpm: add check after commands attribs tab allocation

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>
drivers/char/tpm/tpm2-cmd.c