On Mon, Nov 13, 2017 at 04:12:06PM +0000, James Hogan wrote:
From: James Hogan jhogan@kernel.org
Fix uninitialized variable warning in the Octeon EDAC driver, as seen in MIPS cavium_octeon_defconfig builds since v4.14 with Codescape GNU Tools 2016.05-03:
drivers/edac/octeon_edac-lmc.c In function ‘octeon_lmc_edac_poll_o2’: drivers/edac/octeon_edac-lmc.c:87:24: warning: ‘((long unsigned int*)&int_reg)[1]’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (int_reg.s.sec_err || int_reg.s.ded_err) { ^
This was introduced in commit 1bc021e81565 ("EDAC: Octeon: Add error injection support"), and is fixed by initialising the whole int_reg variable to zero before the conditional assignments in the error injection case.
Fixes: 1bc021e81565 ("EDAC: Octeon: Add error injection support") Signed-off-by: James Hogan jhogan@kernel.org Cc: Ralf Baechle ralf@linux-mips.org Cc: David Daney david.daney@cavium.com Cc: Borislav Petkov bp@alien8.de Cc: Mauro Carvalho Chehab mchehab@kernel.org Cc: Daniel Walker dwalker@fifo99.com Cc: Steven J. Hill steven.hill@cavium.com Cc: linux-edac@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: stable@vger.kernel.org # 3.15+
Comments appreciated. Is this correct?
I've added the stable tag on the assumption that this might matter. If not it can be changed. It'd be nice to have it in 4.14 though to silence the warning since the driver was added to cavium_octeon_defconfig in commit f922bc0ad08b ("MIPS: Octeon: cavium_octeon_defconfig: Enable more drivers").
drivers/edac/octeon_edac-lmc.c | 1 + 1 file changed, 1 insertion(+)
Applied, thanks.