diff options
author | Colin Ian King | 2016-11-15 14:27:22 +0100 |
---|---|---|
committer | Jarkko Sakkinen | 2016-11-28 00:31:32 +0100 |
commit | 79eec5b940cffff14c7bd1b9eb856ccb36274cc2 (patch) | |
tree | f8985c0022ce634eed180a5968a35f690ee7ba73 /drivers/char/tpm/tpm_eventlog.c | |
parent | tpm: cleanup of printk error messages (diff) | |
download | kernel-qcow2-linux-79eec5b940cffff14c7bd1b9eb856ccb36274cc2.tar.gz kernel-qcow2-linux-79eec5b940cffff14c7bd1b9eb856ccb36274cc2.tar.xz kernel-qcow2-linux-79eec5b940cffff14c7bd1b9eb856ccb36274cc2.zip |
tpm: return -ENODEV if np is not set
device_node np contains a garbage value from the stack and it
is only set if chip->dev.parent->of_node is not null. Thus the
check for a null np won't spot a garbage value of np from the
stack if chip->dev.parent->of_node is null and if np contains
an garbage non-null value.
I believe the correct fix is to return -ENODEV if and only if
chip->dev.parent->of_node is null.
Found with static analysis by CoverityScan, CID 1377755
Signed-off-by: Colin Ian King <colin.king@canonical.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>
Diffstat (limited to 'drivers/char/tpm/tpm_eventlog.c')
0 files changed, 0 insertions, 0 deletions