]> git.baikalelectronics.ru Git - kernel.git/commit
tpm: silence an array overflow warning
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 3 Feb 2017 10:30:40 +0000 (13:30 +0300)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Fri, 3 Feb 2017 20:33:55 +0000 (22:33 +0200)
commit19c2054f00c52cfc6741e590e641ec318540e1a6
tree80821aaaa0c0402158a769ad88c03d7437c3069c
parentd7f03e69c9d5ae05308cf8eb6580a7059fccd298
tpm: silence an array overflow warning

We should check that we're within bounds first before checking that
"chip->active_banks[i] != TPM2_ALG_ERROR" so I've re-ordered the two
checks.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/tpm-interface.c