Thread (42 messages) flat view 42 messages, 4 authors, 2019-02-08

Re: [PATCH v11 00/16] Remove nested TPM operations

From: Stefan Berger <stefanb@linux.ibm.com>
Date: 2019-02-08 13:10:42
Also in: linux-integrity, lkml

On 2/8/19 8:02 AM, Jarkko Sakkinen wrote:
On Fri, Feb 08, 2019 at 07:05:26AM -0500, Stefan Berger wrote:
quoted
See my comment on [PATCH v11 08/16]. It needs to be added in that patch
since otherwise rc holds a non-zero value on function exit, which is wrong
at that point.
The snippet in question:

rc = chip->ops->send(chip, buf, count);
if (rc < 0) {
	if (rc != -EPIPE)
		dev_err(&chip->dev,
			"%s: tpm_send: error %d\n", __func__, rc);
	return rc;
}

if (chip->flags & TPM_CHIP_FLAG_IRQ)
	goto out_recv;

'send()' ought to return zero on success case.

This is how the snippet was before applying any patches scheduled for
v5.1:

rc = chip->ops->send(chip, buf, count);
if (rc < 0) {
	if (rc != -EPIPE)
		dev_err(&chip->dev,
			"%s: tpm_send: error %d\n", __func__, rc);
	return rc;
}

if (chip->flags & TPM_CHIP_FLAG_IRQ)
	goto out_recv;

Does not compute.
tpm_tis_send_main returns 'len' and that's what we have here.


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