qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: Stefan Berger <stefanb@linux.vnet.ibm.com>
Cc: QEMU <qemu-devel@nongnu.org>, P J P <ppandit@redhat.com>,
	stefanb@linux.ibm.com
Subject: Re: [Qemu-devel] [PATCH v3 2/3] tpm: Make sure new locality passed to tpm_tis_prep_abort() is valid
Date: Tue, 4 Dec 2018 19:19:39 +0400	[thread overview]
Message-ID: <CAJ+F1CLMFMNrs_r5Fk=6JcJsQuEdXR807_D3ENybHr8MCphJ0A@mail.gmail.com> (raw)
In-Reply-To: <20181204150427.2459814-3-stefanb@linux.vnet.ibm.com>

On Tue, Dec 4, 2018 at 7:04 PM Stefan Berger <stefanb@linux.vnet.ibm.com> wrote:
>
> Make sure that the new locality passed to tpm_tis_prep_abort()
> is valid.
>
> Add a comment to aborting_locty that it may be any locality, including
> TPM_TIS_NO_LOCALITY.
>
> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  hw/tpm/tpm_tis.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
> index 176d424ed9..04e4ad9212 100644
> --- a/hw/tpm/tpm_tis.c
> +++ b/hw/tpm/tpm_tis.c
> @@ -263,7 +263,9 @@ static void tpm_tis_prep_abort(TPMState *s, uint8_t locty, uint8_t newlocty)
>  {
>      uint8_t busy_locty;
>
> -    s->aborting_locty = locty;
> +    assert(TPM_TIS_IS_VALID_LOCTY(newlocty));
> +
> +    s->aborting_locty = locty; /* may also be TPM_TIS_NO_LOCALITY */
>      s->next_locty = newlocty;  /* locality after successful abort */
>
>      /*
> --
> 2.17.1
>


-- 
Marc-André Lureau

  reply	other threads:[~2018-12-04 15:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 15:04 [Qemu-devel] [PATCH v3 0/3] Cleanup and locality range check Stefan Berger
2018-12-04 15:04 ` [Qemu-devel] [PATCH v3 1/3] tpm: Remove unused locty parameter from tpm_tis_abort() Stefan Berger
2018-12-04 15:04 ` [Qemu-devel] [PATCH v3 2/3] tpm: Make sure new locality passed to tpm_tis_prep_abort() is valid Stefan Berger
2018-12-04 15:19   ` Marc-André Lureau [this message]
2018-12-04 15:04 ` [Qemu-devel] [PATCH v3 3/3] tpm: Make sure the locality received from backend " Stefan Berger
2018-12-04 15:20   ` Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ+F1CLMFMNrs_r5Fk=6JcJsQuEdXR807_D3ENybHr8MCphJ0A@mail.gmail.com' \
    --to=marcandre.lureau@gmail.com \
    --cc=ppandit@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanb@linux.ibm.com \
    --cc=stefanb@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).