sched: prevent out of bound access in sched_group_energy()

group_idle_state() can return INT_MAX + 1 which is undefined behaviour
when there is no CPUs in sched_group.  Prevent such by error correctly.

Change-Id: If9796c829c091e461231569dc38c5e5456f58037
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
[clingutla@codeaurora.org: Fixed trivial merge conflicts and squashed
  msm-4.14 change]
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
1 file changed