lkml.org 
[lkml]   [2018]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] sched: psi: Fix a GCC uninitialized warning
Date
I find the following warning when compiling the kernel.

kernel/sched/psi.c:639:13: warning: 'rq' may be used uninitialized in this function [-Wmaybe-uninitialized]
struct rq *rq;

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
kernel/sched/psi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index 7cdecfc..2d8a1f2 100644
--- a/kernel/sched/psi.c
+++ b/kernel/sched/psi.c
@@ -636,7 +636,7 @@ void cgroup_move_task(struct task_struct *task, struct css_set *to)
bool move_psi = !psi_disabled;
unsigned int task_flags = 0;
struct rq_flags rf;
- struct rq *rq;
+ struct rq *rq = NULL;

if (move_psi) {
rq = task_rq_lock(task, &rf);
--
1.7.12.4
\
 
 \ /
  Last update: 2018-09-19 07:29    [W:0.062 / U:1.796 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site