Re: [PATCH v4 1/2] tpm: Unify the send callback behaviourä

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 08, 2019 at 09:00:57PM +0200, Jarkko Sakkinen wrote:
> It all looks now legit, but just in case I'll add a check for the return
> value to tpm_try_transmit() and a warning if it is not zero in the
> success case (and after that zeroing of rc).

Now the commits are applied both master and next, and these are
the checks for send():

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

/* A sanity check. send() should just return zero on success e.g.
 * not the command length.
 */
if (rc > 0) {
	dev_warn(&chip->dev,
		 "%s: send(): invalid value %d\n", __func__, rc);
	rc = 0;
}

Should be fairly safe play now.

/Jarkko



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux