sched: core_ctl: Fix possible uninitialized variable

While setting boost to cluster_data, we iterate clusters with local
uninitialized cluster variable, it is possible that, the cluster
could be null and is used in trace point.

Fix it by moving trace print to cluster validated point.

Change-Id: I466a92f2640cd5058f79355ee0cf354c41c79f7b
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
This commit is contained in:
Lingutla Chandrasekhar 2020-06-23 17:52:27 +05:30
parent 37e541f76d
commit 5f0d8ee6ba

View File

@ -866,7 +866,7 @@ static u64 core_ctl_check_timestamp;
int core_ctl_set_boost(bool boost)
{
unsigned int index = 0;
struct cluster_data *cluster;
struct cluster_data *cluster = NULL;
unsigned long flags;
int ret = 0;
bool boost_state_changed = false;
@ -897,7 +897,8 @@ int core_ctl_set_boost(bool boost)
apply_need(cluster);
}
trace_core_ctl_set_boost(cluster->boost, ret);
if (cluster)
trace_core_ctl_set_boost(cluster->boost, ret);
return ret;
}