From: Aibing Chen <chenaibing@cmss.chinamobile.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>
Cc: linux-edac@vger.kernel.org, linux-mips@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] EDAC/octeon: enlarge the L2C error message buffer
Date: Sat, 14 Nov 2026 20:15:15 +0800 [thread overview]
Message-ID: <20261114121516.1306-1-chenaibing@cmss.chinamobile.com> (raw)
_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));
next reply other threads:[~2026-11-14 12:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 12:15 Aibing Chen [this message]
2026-12-05 11:32 ` Thomas Bogendoerfer
2026-12-05 18:19 ` Borislav Petkov
2026-12-05 19:56 ` Thomas Bogendoerfer
2026-12-05 22:00 ` Borislav Petkov
2026-12-06 11:09 ` Thomas Bogendoerfer
2026-12-06 14:28 ` Aibing Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261114121516.1306-1-chenaibing@cmss.chinamobile.com \
--to=chenaibing@cmss.chinamobile.com \
--cc=bp@alien8.de \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=tsbogend@alpha.franken.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®