Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f0d8ee6 authored by Lingutla Chandrasekhar's avatar Lingutla Chandrasekhar
Browse files

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: default avatarLingutla Chandrasekhar <clingutla@codeaurora.org>
parent 37e541f7
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -866,7 +866,7 @@ static u64 core_ctl_check_timestamp;
int core_ctl_set_boost(bool boost)
int core_ctl_set_boost(bool boost)
{
{
	unsigned int index = 0;
	unsigned int index = 0;
	struct cluster_data *cluster;
	struct cluster_data *cluster = NULL;
	unsigned long flags;
	unsigned long flags;
	int ret = 0;
	int ret = 0;
	bool boost_state_changed = false;
	bool boost_state_changed = false;
@@ -897,6 +897,7 @@ int core_ctl_set_boost(bool boost)
			apply_need(cluster);
			apply_need(cluster);
	}
	}


	if (cluster)
		trace_core_ctl_set_boost(cluster->boost, ret);
		trace_core_ctl_set_boost(cluster->boost, ret);


	return ret;
	return ret;