public inbox for keyrings@vger.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: linux-kernel@vger.kernel.org, keyrings@vger.kernel.org,
	Stefan Berger <stefanb@linux.ibm.com>,
	Jarkko Sakkinen <jarkko.sakkinen@opinsys.com>,
	Peter Huewe <peterhuewe@gmx.de>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	Mimi Zohar <zohar@linux.ibm.com>,
	David Howells <dhowells@redhat.com>,
	Paul Moore <paul@paul-moore.com>,
	James Morris <jmorris@namei.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	"open list:TPM DEVICE DRIVER" <linux-integrity@vger.kernel.org>,
	"open list:SECURITY SUBSYSTEM"
	<linux-security-module@vger.kernel.org>
Subject: Re: [PATCH v4] tpm: Managed allocations for tpm_buf instances
Date: Thu, 3 Jul 2025 01:42:09 +0300	[thread overview]
Message-ID: <aGW1wdJQ2oFpGQwq@kernel.org> (raw)
In-Reply-To: <20250702125725.GA904431@ziepe.ca>

On Wed, Jul 02, 2025 at 09:57:25AM -0300, Jason Gunthorpe wrote:
> On Tue, Jul 01, 2025 at 05:51:35PM +0300, Jarkko Sakkinen wrote:
> > @@ -32,28 +32,30 @@ struct tpm_readpubek_out {
> >  static ssize_t pubek_show(struct device *dev, struct device_attribute *attr,
> >  			  char *buf)
> >  {
> > -	struct tpm_buf tpm_buf;
> > +	struct tpm_buf *tpm_buf __free(kfree) = NULL;
> >  	struct tpm_readpubek_out *out;
> >  	int i;
> >  	char *str = buf;
> >  	struct tpm_chip *chip = to_tpm_chip(dev);
> >  	char anti_replay[20];
> >  
> > +	tpm_buf = tpm_buf_alloc();
> > +	if (!tpm_buf)
> > +		return -ENOMEM;
> 
> apprently this isn't the style guide, you are supposed to write:
> 
>   	char anti_replay[20];
> 
> 	struct tpm_buf *tpm_buf __free(kfree) =  tpm_buf_alloc();
> 	if (!tpm_buf)
> 		return -ENOMEM;

Sounds fair to me. I'll shift to this direction in the next revision.

> 
> Jason

BR, Jarkko

BR, Jarkko

      reply	other threads:[~2025-07-02 22:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-01 14:51 [PATCH v4] tpm: Managed allocations for tpm_buf instances Jarkko Sakkinen
2025-07-01 21:42 ` Stefan Berger
2025-07-02 22:38   ` Jarkko Sakkinen
2025-07-02  2:51 ` James Bottomley
2025-07-02 22:39   ` Jarkko Sakkinen
2025-07-02 12:57 ` Jason Gunthorpe
2025-07-02 22:42   ` Jarkko Sakkinen [this message]

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=aGW1wdJQ2oFpGQwq@kernel.org \
    --to=jarkko@kernel.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=dhowells@redhat.com \
    --cc=jarkko.sakkinen@opinsys.com \
    --cc=jgg@ziepe.ca \
    --cc=jmorris@namei.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=peterhuewe@gmx.de \
    --cc=serge@hallyn.com \
    --cc=stefanb@linux.ibm.com \
    --cc=zohar@linux.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