Skip to content
Commit 79eec5b9 authored by Colin Ian King's avatar Colin Ian King Committed by Jarkko Sakkinen
Browse files

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: default avatarColin Ian King <colin.king@canonical.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
parent 5efae7d6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment