aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power/cpupower/lib
diff options
context:
space:
mode:
authorShuah Khan <skhan@linuxfoundation.org>2020-06-29 14:02:23 -0600
committerShuah Khan <skhan@linuxfoundation.org>2020-07-06 16:11:04 -0600
commitcbf25270933742c4a6d8671bba5c79a4e879cff3 (patch)
tree880390fadb922eb46647e3a70d267551df2ca463 /tools/power/cpupower/lib
parentcpupower: Fix comparing pointer to 0 coccicheck warns (diff)
downloadlinux-dev-cbf25270933742c4a6d8671bba5c79a4e879cff3.tar.xz
linux-dev-cbf25270933742c4a6d8671bba5c79a4e879cff3.zip
cpupower: Fix NULL but dereferenced coccicheck errors
Fix NULL but dereferenced coccicheck errors found by: make coccicheck MODE=report M=tools/power/cpupower tools/power/cpupower/lib/cpufreq.c:384:19-23: ERROR: first is NULL but dereferenced. tools/power/cpupower/lib/cpufreq.c:440:19-23: ERROR: first is NULL but dereferenced. tools/power/cpupower/lib/cpufreq.c:308:19-23: ERROR: first is NULL but dereferenced. tools/power/cpupower/lib/cpufreq.c:753:19-23: ERROR: first is NULL but dereferenced. Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/power/cpupower/lib')
-rw-r--r--tools/power/cpupower/lib/cpufreq.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/power/cpupower/lib/cpufreq.c b/tools/power/cpupower/lib/cpufreq.c
index 6e04304560ca..c3b56db8b921 100644
--- a/tools/power/cpupower/lib/cpufreq.c
+++ b/tools/power/cpupower/lib/cpufreq.c
@@ -285,7 +285,7 @@ struct cpufreq_available_governors *cpufreq_get_available_governors(unsigned
} else {
first = malloc(sizeof(*first));
if (!first)
- goto error_out;
+ return NULL;
current = first;
}
current->first = first;
@@ -362,7 +362,7 @@ struct cpufreq_available_frequencies
} else {
first = malloc(sizeof(*first));
if (!first)
- goto error_out;
+ return NULL;
current = first;
}
current->first = first;
@@ -418,7 +418,7 @@ struct cpufreq_available_frequencies
} else {
first = malloc(sizeof(*first));
if (!first)
- goto error_out;
+ return NULL;
current = first;
}
current->first = first;
@@ -493,7 +493,7 @@ static struct cpufreq_affected_cpus *sysfs_get_cpu_list(unsigned int cpu,
} else {
first = malloc(sizeof(*first));
if (!first)
- goto error_out;
+ return NULL;
current = first;
}
current->first = first;
@@ -726,7 +726,7 @@ struct cpufreq_stats *cpufreq_get_stats(unsigned int cpu,
} else {
first = malloc(sizeof(*first));
if (!first)
- goto error_out;
+ return NULL;
current = first;
}
current->first = first;