Patch "MIPS: generic/yamon-dt: fix uninitialized variable error" has been added to the 5.4-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    MIPS: generic/yamon-dt: fix uninitialized variable error

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mips-generic-yamon-dt-fix-uninitialized-variable-err.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 07eb927bb0f6f49f438bd3c7775b3797e2f82f0b
Author: Colin Ian King <colin.i.king@xxxxxxxxxxxxxx>
Date:   Wed Nov 10 23:28:24 2021 +0000

    MIPS: generic/yamon-dt: fix uninitialized variable error
    
    [ Upstream commit 255e51da15baed47531beefd02f222e4dc01f1c1 ]
    
    In the case where fw_getenv returns an error when fetching values
    for ememsizea and memsize then variable phys_memsize is not assigned
    a variable and will be uninitialized on a zero check of phys_memsize.
    Fix this by initializing phys_memsize to zero.
    
    Cleans up cppcheck error:
    arch/mips/generic/yamon-dt.c:100:7: error: Uninitialized variable: phys_memsize [uninitvar]
    
    Fixes: f41d2430bbd6 ("MIPS: generic/yamon-dt: Support > 256MB of RAM")
    Signed-off-by: Colin Ian King <colin.i.king@xxxxxxxxx>
    Signed-off-by: Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/mips/generic/yamon-dt.c b/arch/mips/generic/yamon-dt.c
index a3aa22c77cadc..a07a5edbcda78 100644
--- a/arch/mips/generic/yamon-dt.c
+++ b/arch/mips/generic/yamon-dt.c
@@ -75,7 +75,7 @@ static unsigned int __init gen_fdt_mem_array(
 __init int yamon_dt_append_memory(void *fdt,
 				  const struct yamon_mem_region *regions)
 {
-	unsigned long phys_memsize, memsize;
+	unsigned long phys_memsize = 0, memsize;
 	__be32 mem_array[2 * MAX_MEM_ARRAY_ENTRIES];
 	unsigned int mem_entries;
 	int i, err, mem_off;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux