sched: ems: avoid to access empty energy table
authorPark Bumgyu <bumgyu.park@samsung.com>
Thu, 5 Apr 2018 05:36:40 +0000 (14:36 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:35:31 +0000 (17:35 +0900)
commit0b010e6e5f5dacdcc1d67f7adee38f5f8a7cdf6e
tree60974f3db687dfdd301ba99d9ec46c9e2dc28725
parentec3d88f773a5c2cd81f6d3354fc351161618526f
sched: ems: avoid to access empty energy table

Accessing the energy table without allocation cause a NULL pointer
exception. energy_table.nr_states have values after the energy table
created, so check the nr_states to avoid problem.

Change-Id: I90d6c9b8ff5ac0eb67b92ab0bb57b911d8f65091
Signed-off-by: Park Bumgyu <bumgyu.park@samsung.com>
kernel/sched/ems/core.c