linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: Nayna <nayna@linux.vnet.ibm.com>, Peter Huewe <peterhuewe@gmx.de>,
	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 RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array
Date: Tue, 11 Oct 2016 10:53:55 -0600	[thread overview]
Message-ID: <20161011165355.GB6881@obsidianresearch.com> (raw)
In-Reply-To: <20161011112315.GB21688@intel.com>

On Tue, Oct 11, 2016 at 02:23:15PM +0300, Jarkko Sakkinen wrote:
> > >+	chip->bios_dir[cnt] =
> > >  	    securityfs_create_file("ascii_bios_measurements",
> > >-				   S_IRUSR | S_IRGRP, tpm_dir,
> > >+				   S_IRUSR | S_IRGRP, chip->bios_dir[0],
> > >  				   (void *)&tpm_ascii_b_measurments_seqops,
> > >  				   &tpm_bios_measurements_ops);

> > >+	if (is_bad(chip->bios_dir[cnt]))
> > >+		goto err;

> > >+err:
> > >+	chip->bios_dir[cnt] = NULL;
> > 
> > The updated patch looks fine.
> > Just, I am not sure if NULL assignment is needed.
> 
> It's not needed.

It is required to switch an ERR_PTR to NULL, see is_bad()

The original version that used a counter in chip did not need it.

Jason

  reply	other threads:[~2016-10-11 17:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-01 19:25 [PATCH RESEND 0/3] Clean up handling of event log files Jarkko Sakkinen
2016-10-01 19:25 ` [PATCH RESEND 1/3] tpm: define a generic open() method for ascii & bios measurements Jarkko Sakkinen
2016-10-08 10:56   ` Jarkko Sakkinen
2016-10-01 19:25 ` [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array Jarkko Sakkinen
2016-10-02 21:28   ` Jason Gunthorpe
2016-10-03 12:21     ` Jarkko Sakkinen
2016-10-08 11:01       ` Jarkko Sakkinen
2016-10-10 18:53   ` Nayna
2016-10-11 11:23     ` Jarkko Sakkinen
2016-10-11 16:53       ` Jason Gunthorpe [this message]
2016-10-11 17:19         ` Nayna
2016-10-11 18:12           ` Jarkko Sakkinen
2016-10-11 18:09         ` Jarkko Sakkinen
2016-10-01 19:25 ` [PATCH RESEND 3/3] tpm: drop tpm1_chip_register(/unregister) 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=20161011165355.GB6881@obsidianresearch.com \
    --to=jgunthorpe@obsidianresearch.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nayna@linux.vnet.ibm.com \
    --cc=peterhuewe@gmx.de \
    --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).