]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
EDAC/i5000: Fix snprintf() size calculation in calculate_dimm_size()
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 9 Dec 2025 14:36:59 +0000 (17:36 +0300)
committerTony Luck <tony.luck@intel.com>
Wed, 17 Dec 2025 17:59:17 +0000 (09:59 -0800)
commit7b5c7e83ac405ff9ecbdd92b37a477f4288f8814
tree9cf9f60ae42ba14baac2bbab89effef5318a71f5
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8
EDAC/i5000: Fix snprintf() size calculation in calculate_dimm_size()

The snprintf() can't really overflow because we're writing a max of 42
bytes to a PAGE_SIZE buffer.  But the limit calculation doesn't take
the first 11 bytes that we wrote into consideration so the limit is
not correct.  Just fix it for correctness even though it doesn't
affect runtime.

Fixes: 64e1fdaf55d6 ("i5000_edac: Fix the logic that retrieves memory information")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Link: https://patch.msgid.link/07cd652c51e77aad5a8350e1a7cd9407e5bbe373.1765290801.git.dan.carpenter@linaro.org
drivers/edac/i5000_edac.c