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

Commit 43d98659 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 ecbb3684
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2018, 2020, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * it under the terms of the GNU General Public License version 2 and
@@ -819,7 +819,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;
@@ -850,6 +850,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;