Re: [PATCH RFC] EDAC: octeon: Fix uninitialized variable warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 13, 2017 at 04:12:06PM +0000, James Hogan wrote:
> From: James Hogan <jhogan@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> Cc: Ralf Baechle <ralf@xxxxxxxxxxxxxx>
> Cc: David Daney <david.daney@xxxxxxxxxx>
> Cc: Borislav Petkov <bp@xxxxxxxxx>
> Cc: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
> Cc: Daniel Walker <dwalker@xxxxxxxxxx>
> Cc: Steven J. Hill <steven.hill@xxxxxxxxxx>
> Cc: linux-edac@xxxxxxxxxxxxxxx
> Cc: linux-mips@xxxxxxxxxxxxxx
> Cc: <stable@xxxxxxxxxxxxxxx> # 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.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]