tpmdd-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Peter Huewe <peterhuewe@gmx.de>,
	linux-security-module@vger.kernel.org,
	Stefan Berger <stefanb@linux.vnet.ibm.com>,
	Marcel Selhorst <tpmdd@selhorst.net>,
	"moderated list:TPM DEVICE DRIVER"
	<tpmdd-devel@lists.sourceforge.net>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tpm: check for TPM_CHIP_FLAG_TPM2 before calling tpm2_shutdown()
Date: Mon, 25 Apr 2016 21:48:45 +0300	[thread overview]
Message-ID: <20160425184845.GA15368@intel.com> (raw)
In-Reply-To: <20160425175720.GB7675@obsidianresearch.com>

On Mon, Apr 25, 2016 at 11:57:20AM -0600, Jason Gunthorpe wrote:
> On Mon, Apr 25, 2016 at 12:21:30PM +0300, Jarkko Sakkinen wrote:
> > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > Reported-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
> >  drivers/char/tpm/tpm-chip.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Reviewed-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> Fixes: 20e0152393b41 ("tpm: fix crash in tpm_tis deinitialization")

Thanks and thanks for the fixes line (forgot to add it) :)

/Jarkko

> > diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
> > index a12db8e..1965dc7 100644
> > +++ b/drivers/char/tpm/tpm-chip.c
> > @@ -270,7 +270,8 @@ static void tpm_del_char_device(struct tpm_chip *chip)
> >  
> >  	/* Make the driver uncallable. */
> >  	down_write(&chip->ops_sem);
> > -	tpm2_shutdown(chip, TPM2_SU_CLEAR);
> > +	if (chip->flags & TPM_CHIP_FLAG_TPM2)
> > +		tpm2_shutdown(chip, TPM2_SU_CLEAR);
> >  	chip->ops = NULL;
> >  	up_write(&chip->ops_sem);
> >  }
> 

  reply	other threads:[~2016-04-25 18:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25  9:21 [PATCH] tpm: check for TPM_CHIP_FLAG_TPM2 before calling tpm2_shutdown() Jarkko Sakkinen
     [not found] ` <1461576090-24813-1-git-send-email-jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-04-25 17:57   ` Jason Gunthorpe
2016-04-25 18:48     ` Jarkko Sakkinen [this message]
     [not found]     ` <20160425175720.GB7675-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-04-25 19:09       ` Stefan Berger

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=20160425184845.GA15368@intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@selhorst.net \
    /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).