]> Gentwo Git Trees - linux/.git/commit
efi/cper: Adjust infopfx size to accept an extra space
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 14 Aug 2025 16:52:53 +0000 (09:52 -0700)
committerArd Biesheuvel <ardb@kernel.org>
Fri, 21 Nov 2025 08:42:02 +0000 (09:42 +0100)
commit8ad2c72e21efb3dc76c5b14089fa7984cdd87898
tree40c680939bb3ca0c3e36fe7d438659181781262e
parent05954511b73e748d0370549ad9dd9cd95297d97a
efi/cper: Adjust infopfx size to accept an extra space

Compiling with W=1 with werror enabled produces an error:

drivers/firmware/efi/cper-arm.c: In function ‘cper_print_proc_arm’:
drivers/firmware/efi/cper-arm.c:298:64: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
  298 |                         snprintf(infopfx, sizeof(infopfx), "%s ", newpfx);
      |                                                                ^
drivers/firmware/efi/cper-arm.c:298:25: note: ‘snprintf’ output between 2 and 65 bytes into a destination of size 64
  298 |                         snprintf(infopfx, sizeof(infopfx), "%s ", newpfx);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As the logic there adds an space at the end of infopx buffer.
Add an extra space to avoid such warning.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/cper-arm.c