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 <zhongji...@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