[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D1FJWF5LK0T4.K5YFU4OBSKCI@kernel.org>
Date: Tue, 21 May 2024 21:57:29 +0300
From: "Jarkko Sakkinen" <jarkko@...nel.org>
To: "Matt Ochs" <mochs@...dia.com>
Cc: "peterhuewe@....de" <peterhuewe@....de>, "jgg@...pe.ca" <jgg@...pe.ca>,
"Krishna Yarlagadda" <kyarlagadda@...dia.com>,
"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
"linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Vishwaroop
A" <va@...dia.com>, "Carol Soto" <csoto@...dia.com>
Subject: Re: [PATCH] tpm_tis_spi: Account for SPI header when allocating TPM
SPI xfer buffer
On Tue May 21, 2024 at 8:59 PM EEST, Matt Ochs wrote:
> > On May 21, 2024, at 10:55 AM, Jarkko Sakkinen <jarkko@...nel.org> wrote:
> >>
> >> /*
> >> * TCG SPI flow control is documented in section 6.4 of the spec[1]. In short,
> >> @@ -247,7 +249,7 @@ static int tpm_tis_spi_write_bytes(struct tpm_tis_data *data, u32 addr,
> >> int tpm_tis_spi_init(struct spi_device *spi, struct tpm_tis_spi_phy *phy,
> >> int irq, const struct tpm_tis_phy_ops *phy_ops)
> >> {
> >> - phy->iobuf = devm_kmalloc(&spi->dev, MAX_SPI_FRAMESIZE, GFP_KERNEL);
> >> + phy->iobuf = devm_kmalloc(&spi->dev, MAX_SPI_BUFSIZE, GFP_KERNEL);
> >
> > It would better to open code here "SPI_HDRSIZE + MAX_SPI_FRAMESIZE".
> >
> > I.e. less cross-referencing and documents better what is going on at
> > the call site.
>
> Sure, will make this change in a v2.
Yeah, and thanks for spotting the bug and fixing it! Looking forward to
the final fix.
BR, Jarkko
Powered by blists - more mailing lists