Skip to content

Commit ccf6fb8

Browse files
vaverinJarkko Sakkinen
authored andcommitted
tpm_tis: extra chip->ops check on error path in tpm_tis_core_init
Found by smatch: drivers/char/tpm/tpm_tis_core.c:1088 tpm_tis_core_init() warn: variable dereferenced before check 'chip->ops' (see line 979) 'chip->ops' is assigned in the beginning of function in tpmm_chip_alloc->tpm_chip_alloc and is used before first possible goto to error path. Signed-off-by: Vasily Averin <[email protected]> Reviewed-by: Jerry Snitselaar <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent eac9347 commit ccf6fb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/char/tpm/tpm_tis_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
10851085

10861086
return 0;
10871087
out_err:
1088-
if ((chip->ops != NULL) && (chip->ops->clk_enable != NULL))
1088+
if (chip->ops->clk_enable != NULL)
10891089
chip->ops->clk_enable(chip, false);
10901090

10911091
tpm_tis_remove(chip);

0 commit comments

Comments
 (0)