* [PATCH] sched: psi: Fix a GCC uninitialized warning
@ 2018-09-19 5:16 zhong jiang
0 siblings, 0 replies; only message in thread
From: zhong jiang @ 2018-09-19 5:16 UTC (permalink / raw)
To: mingo; +Cc: peterz, linux-kernel
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-09-19 5:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-19 5:16 [PATCH] sched: psi: Fix a GCC uninitialized warning zhong jiang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).