Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1499126
| From | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array |
| Date | 2016-10-11 20:20 +0200 |
| Message-ID | <sr9OF-1Fj-19@gated-at.bofh.it> (permalink) |
| References | <sny8V-4tY-3@gated-at.bofh.it> <sny8V-4tY-1@gated-at.bofh.it> <sqNXP-4MD-7@gated-at.bofh.it> <sr3pU-666-19@gated-at.bofh.it> <sr92h-15w-3@gated-at.bofh.it> |
| Organization | Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo |
On Tue, Oct 11, 2016 at 10:53:55AM -0600, Jason Gunthorpe wrote:
> 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.
Oops, sorry. I added it back. Thanks for pointing this out.
> Jason
/Jarkko
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH RESEND 0/3] Clean up handling of event log files Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-10-01 21:30 +0200
[PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-10-01 21:30 +0200
Re: [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-10-02 23:30 +0200
Re: [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-10-03 14:30 +0200
Re: [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-10-08 13:10 +0200
Re: [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array Nayna <nayna@linux.vnet.ibm.com> - 2016-10-10 21:00 +0200
Re: [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-10-11 13:30 +0200
Re: [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array Nayna <nayna@linux.vnet.ibm.com> - 2016-10-11 19:30 +0200
Re: [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-10-11 20:20 +0200
Re: [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-10-11 19:40 +0200
Re: [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-10-11 20:20 +0200
[PATCH RESEND 3/3] tpm: drop tpm1_chip_register(/unregister) Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-10-01 21:30 +0200
[PATCH RESEND 1/3] tpm: define a generic open() method for ascii & bios measurements Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-10-01 21:30 +0200
Re: [PATCH RESEND 1/3] tpm: define a generic open() method for ascii & bios measurements Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-10-08 13:10 +0200
csiph-web