All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Nayna <nayna@linux.vnet.ibm.com>,
	Stefan Berger <stefanb@linux.vnet.ibm.com>,
	tpmdd-devel@lists.sourceforge.net,
	linux-security-module@vger.kernel.org
Subject: Re: [PATCH 2/2] tpm: Fix error code handling after tpm_bios_log_setup
Date: Mon, 21 Nov 2016 22:29:15 +0200	[thread overview]
Message-ID: <20161121202915.he2pgzoqza3rugnd@intel.com> (raw)
In-Reply-To: <20161121171530.GB22237@obsidianresearch.com>

On Mon, Nov 21, 2016 at 10:15:30AM -0700, Jason Gunthorpe wrote:
> On Mon, Nov 21, 2016 at 12:06:20AM +0530, Nayna wrote:
> > >  	rc = tpm_bios_log_setup(chip);
> > >-	if (rc == -ENODEV)
> > >+	if (rc != 0 && rc != -ENODEV)
> > >  		return rc;
> > 
> > This will return in case of -EFAULT as well, where the check is that log is
> > already initialized. Do we want to fail the probe here as well ?
> > 
> > -EFAULT is returned from tpm_read_log() as below:
> 
> That is fine, we should never read the log twice.

I just went through tpm_bios_log_setup(), tpm_read_log_of() and
tpm_read_log_acpi(). The error handling is sound now but the condition
should be in tpm_bios_log_setup(). Not in tpm_chip_register().

It is applied but if you don't mind I would like make a small commit
that moves the condition to that function.

I think tpm_chip_register() should only care when something went wrong.

/Jarkko

  reply	other threads:[~2016-11-21 20:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18  0:30 [PATCH 1/2] tpm: Check for parent device being NULL Stefan Berger
     [not found] ` <1479429004-7962-1-git-send-email-stefanb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2016-11-18  0:30   ` [PATCH 2/2] tpm: Fix error code handling after tpm_bios_log_setup Stefan Berger
     [not found]     ` <1479429004-7962-2-git-send-email-stefanb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2016-11-18 12:26       ` Nayna
2016-11-18 15:52     ` Jarkko Sakkinen
2016-11-19 18:22       ` Jason Gunthorpe
2016-11-20  9:46         ` Jarkko Sakkinen
2016-11-20  9:47           ` Jarkko Sakkinen
2016-11-20 12:14         ` Jarkko Sakkinen
     [not found]           ` <20161120121451.awcraondhcvzpbig-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-21 17:55             ` Jason Gunthorpe
2016-11-21 20:30               ` Jarkko Sakkinen
     [not found]               ` <20161121175520.GA24191-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-21 20:32                 ` Jarkko Sakkinen
2016-11-21 20:36                   ` Jarkko Sakkinen
2016-11-21 20:37                   ` Jason Gunthorpe
     [not found]                     ` <20161121203708.GA7294-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-21 20:46                       ` Jarkko Sakkinen
2016-11-21 20:56                         ` Jason Gunthorpe
2016-11-20 18:36         ` Nayna
2016-11-21 17:15           ` Jason Gunthorpe
2016-11-21 20:29             ` Jarkko Sakkinen [this message]
2016-11-22 16:37               ` Jason Gunthorpe
     [not found]                 ` <20161122163720.GB3956-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-22 16:48                   ` Jarkko Sakkinen
2016-11-22  9:04             ` Nayna
2016-11-18 15:52   ` [PATCH 1/2] tpm: Check for parent device being NULL Jarkko Sakkinen

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=20161121202915.he2pgzoqza3rugnd@intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=nayna@linux.vnet.ibm.com \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=tpmdd-devel@lists.sourceforge.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.