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

Commit 62096841 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cpufreq: stats: Print error messages if table initialization fails"

parents 62cafffc ab4b2356
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -190,12 +190,16 @@ static int __cpufreq_stats_create_table(struct cpufreq_policy *policy,
	if (per_cpu(cpufreq_stats_table, cpu))
		return -EBUSY;
	stat = kzalloc(sizeof(*stat), GFP_KERNEL);
	if ((stat) == NULL)
	if ((stat) == NULL) {
		pr_err("Failed to alloc cpufreq_stats table\n");
		return -ENOMEM;
	}

	ret = sysfs_create_group(&policy->kobj, &stats_attr_group);
	if (ret)
	if (ret) {
		pr_err("Failed to create cpufreq_stats sysfs\n");
		goto error_out;
	}

	stat->cpu = cpu;
	per_cpu(cpufreq_stats_table, cpu) = stat;
@@ -216,6 +220,7 @@ static int __cpufreq_stats_create_table(struct cpufreq_policy *policy,
	stat->time_in_state = kzalloc(alloc_size, GFP_KERNEL);
	if (!stat->time_in_state) {
		ret = -ENOMEM;
		pr_err("Failed to alloc cpufreq_stats table\n");
		goto error_alloc;
	}
	stat->freq_table = (unsigned int *)(stat->time_in_state + count);