char: tpm: Add missing error check for devm_kzalloc
authorKiran Padwal <kiran.padwal@smartplayin.com>
Fri, 19 Sep 2014 07:14:39 +0000 (12:44 +0530)
committerPeter Huewe <peterhuewe@gmx.de>
Sat, 17 Jan 2015 13:00:05 +0000 (14:00 +0100)
commitbb95cd34ba4c9467114acc78eeddd53ab1c10085
tree7805a7a694e47e1c91175d623c31fff3ef4d1bd8
parent398a1e71dc827b994b7f2f56c7c2186fea7f8d75
char: tpm: Add missing error check for devm_kzalloc

Currently these driver are missing a check on the return value of devm_kzalloc,
which would cause a NULL pointer dereference in a OOM situation.

This patch adds a missing check for tpm_i2c_atmel.c and tpm_i2c_nuvoton.c

Cc: stable@vger.kernel.org
Signed-off-by: Kiran Padwal <kiran.padwal@smartplayin.com>
Reviewed-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
drivers/char/tpm/tpm_i2c_atmel.c
drivers/char/tpm/tpm_i2c_nuvoton.c