Patch "sched/vtime: Work around an unitialized variable warning" has been added to the 5.6-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

    sched/vtime: Work around an unitialized variable warning

to the 5.6-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:
     sched-vtime-work-around-an-unitialized-variable-warn.patch
and it can be found in the queue-5.6 subdirectory.

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



commit 56d228de775e2de58b0b43a6360127ed5fac5fbc
Author: Borislav Petkov <bp@xxxxxxx>
Date:   Fri Mar 27 22:43:34 2020 +0100

    sched/vtime: Work around an unitialized variable warning
    
    [ Upstream commit e0d648f9d883ec1efab261af158d73aa30e9dd12 ]
    
    Work around this warning:
    
      kernel/sched/cputime.c: In function â??kcpustat_fieldâ??:
      kernel/sched/cputime.c:1007:6: warning: â??valâ?? may be used uninitialized in this function [-Wmaybe-uninitialized]
    
    because GCC can't see that val is used only when err is 0.
    
    Acked-by: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
    Signed-off-by: Borislav Petkov <bp@xxxxxxx>
    Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20200327214334.GF8015@xxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index dac9104d126f7..ff9435dee1df2 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -1003,12 +1003,12 @@ u64 kcpustat_field(struct kernel_cpustat *kcpustat,
 		   enum cpu_usage_stat usage, int cpu)
 {
 	u64 *cpustat = kcpustat->cpustat;
+	u64 val = cpustat[usage];
 	struct rq *rq;
-	u64 val;
 	int err;
 
 	if (!vtime_accounting_enabled_cpu(cpu))
-		return cpustat[usage];
+		return val;
 
 	rq = cpu_rq(cpu);
 



[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