Hello Jarkko Sakkinen,
This is a semi-automatic email about new static checker warnings.
Commit 7ca110f2679b ("tpm: Address !chip->auth in
tpm_buf_append_hmac_session*()") from Jul 3, 2024, leads to the
following Smatch complaint:
drivers/char/tpm/tpm2-sessions.c:755 tpm_buf_check_hmac_response()
warn: variable dereferenced before check 'auth' (see line 752)
drivers/char/tpm/tpm2-sessions.c
751 u16 tag = be16_to_cpu(head->tag);
752 u32 cc = be32_to_cpu(auth->ordinal);
^^^^^^^^^^^^^
The existing code had an unchecked dereference
753 int parm_len, len, i, handles;
754
755 if (!auth)
^^^^^
The patch adds a NULL check
756 return rc;
757
regards,
dan carpenter