OSDN Git Service

sched/core: Fix null-pointer dereference
authorOlav Haugan <ohaugan@codeaurora.org>
Sat, 16 Jul 2016 17:39:06 +0000 (10:39 -0700)
committerOlav Haugan <ohaugan@codeaurora.org>
Sat, 16 Jul 2016 17:41:32 +0000 (10:41 -0700)
Turning on sched_use_pelt causes a null-pointer dereference in
scheduler. Add correct checking of varable.

CRs-fixed: 1042656
Change-Id: I6e6a57e24b41e4b3d049bfcf694b9ad7e2144dd5
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
kernel/sched/fair.c

index 8594167..958d79e 100644 (file)
@@ -4343,7 +4343,7 @@ __update_load_avg(u64 now, int cpu, struct sched_avg *sa,
                return 0;
        sa->last_update_time = now;
 
-       if (sched_use_pelt && !cfs_rq && weight) {
+       if (sched_use_pelt && cfs_rq && weight) {
                se = container_of(sa, struct sched_entity, avg);
                if (entity_is_task(se) && se->on_rq)
                        dec_hmp_sched_stats_fair(rq_of(cfs_rq), task_of(se));