[PATCH] mtd: spi-nor: reduce stack usage in spi_nor_parse_sfdp()

Michael Walle mwalle at kernel.org
Mon Sep 21 00:55:37 PDT 2026


Hi Arnd,

On Tue Sep 15, 2026 at 9:40 PM CEST, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd at arndb.de>
>
> Two large spi_nor_flash_parameter structures on a function stack
> is really too much, and this can exceed an otherwise reasonable
> frame limit:
>
> drivers/mtd/spi-nor/sfdp.c: In function 'spi_nor_parse_sfdp':
> drivers/mtd/spi-nor/sfdp.c:1717:1: error: the frame size of 1600 bytes is larger than 1536 bytes [-Werror=frame-larger-than=]
>
> Change one of them to a dynamic allocation to make this more reasonable.

Thanks for taking care of that. Will you respin the patch with what
David suggested?

-michael

> Fixes: d20029474a76 ("mtd: spi-nor: push the rollback mechanism into the sfdp module")
> Signed-off-by: Arnd Bergmann <arnd at arndb.de>
> ---
>  drivers/mtd/spi-nor/sfdp.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 297 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20260921/0a928eac/attachment.sig>


More information about the linux-mtd mailing list