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 via email to