All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] EDAC/octeon: enlarge the L2C error message buffer
@ 2026-11-14 12:15 Aibing Chen
  2026-12-05 11:32 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 4+ messages in thread
From: Aibing Chen @ 2026-11-14 12:15 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Borislav Petkov, Tony Luck
  Cc: linux-edac, linux-mips, linux-kernel

_octeon_l2c_poll_oct2() builds an error message by prefixing buf1 with a
short description.  buf1 holds up to 63 characters and the longest
prefix is 33 characters ("Tag Single bit error (corrected):"), so the
message needs up to 97 bytes, but buf2 is only 80 bytes.

Building with W=1 reports a -Wformat-truncation warning for each of the
six snprintf() calls, e.g. for "L2D Double bit error (detected):%s" the
compiler notes that the output can reach 97 bytes including the
terminator, into a destination of size 80.  The printed message then
loses the syndrome, type and way information that buf1 carries.

Size buf2 for the worst case.

Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com>
---
 drivers/edac/octeon_edac-l2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/edac/octeon_edac-l2c.c b/drivers/edac/octeon_edac-l2c.c
index e6b1595a3..5eca6e204 100644
--- a/drivers/edac/octeon_edac-l2c.c
+++ b/drivers/edac/octeon_edac-l2c.c
@@ -62,7 +62,7 @@ static void _octeon_l2c_poll_oct2(struct edac_device_ctl_info *l2c, int tad)
 	union cvmx_l2c_err_tdtx err_tdtx, err_tdtx_reset;
 	union cvmx_l2c_err_ttgx err_ttgx, err_ttgx_reset;
 	char buf1[64];
-	char buf2[80];
+	char buf2[128];
 
 	err_tdtx_reset.u64 = 0;
 	err_tdtx.u64 = cvmx_read_csr(CVMX_L2C_ERR_TDTX(tad));



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-05 19:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-14 12:15 [PATCH] EDAC/octeon: enlarge the L2C error message buffer Aibing Chen
2026-12-05 11:32 ` Thomas Bogendoerfer
2026-12-05 18:19   ` Borislav Petkov
2026-12-05 19:56     ` Thomas Bogendoerfer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.