Thread (1 message) 1 message, 1 author, 2019-11-18

Re: linux-5.4-rc8/drivers/char/tpm/tpm1-cmd.c:735: possible missing return value check

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2019-11-18 09:27:27
Also in: lkml

Possibly related (same subject, not in this thread)

On Mon, Nov 18, 2019 at 09:24:32AM +0000, David Binderman wrote:
Hello there,

linux-5.4-rc8/drivers/char/tpm/tpm1-cmd.c:735:5: style: Variable 'rc' is reassigned a value before the old one has been used. [redundantAssignment]

Source code is

    if (tpm_suspend_pcr)
        rc = tpm1_pcr_extend(chip, tpm_suspend_pcr, dummy_hash,
                     "extending dummy pcr before suspend");

    rc = tpm_buf_init(&buf, TPM_TAG_RQU_COMMAND, TPM_ORD_SAVESTATE);

Suggest add test of rc after call to tpm1_pcr_extend.
Great, how about you submit a patch to resolve this?  That way you can
get the full credit for finding and resolveing the issue?

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help