Skip to content

Commit

Permalink
Merge tag 'linux-cpupower-5.9-rc1' of git://git.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/kernel/git/shuah/linux

Pull cpupower utility updates for v5.9 from Shuah Khan:

"This cpupower update for Linux 5.9-rc1 consists of 2 fixes to
 coccicheck warnings and one change to replacing HTTP links with
 HTTPS ones."

* tag 'linux-cpupower-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux:
  cpupower: Replace HTTP links with HTTPS ones
  cpupower: Fix NULL but dereferenced coccicheck errors
  cpupower: Fix comparing pointer to 0 coccicheck warns
  • Loading branch information
Rafael J. Wysocki committed Jul 27, 2020
2 parents 92ed301 + fa0866a commit 671be01
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions tools/power/cpupower/lib/cpufreq.c
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 2 additions & 2 deletions tools/power/cpupower/man/cpupower-monitor.1
Original file line number Diff line number Diff line change
@@ -170,15 +170,15 @@ displayed.

.SH REFERENCES
"BIOS and Kernel Developer’s Guide (BKDG) for AMD Family 14h Processors"
http://support.amd.com/us/Processor_TechDocs/43170.pdf
https://support.amd.com/us/Processor_TechDocs/43170.pdf

"Intel® Turbo Boost Technology
in Intel® Core™ Microarchitecture (Nehalem) Based Processors"
http://download.intel.com/design/processor/applnots/320354.pdf

"Intel® 64 and IA-32 Architectures Software Developer's Manual
Volume 3B: System Programming Guide"
http://www.intel.com/products/processor/manuals
https://www.intel.com/products/processor/manuals

.SH FILES
.ta
6 changes: 3 additions & 3 deletions tools/power/cpupower/utils/helpers/bitmask.c
Original file line number Diff line number Diff line change
@@ -26,11 +26,11 @@ struct bitmask *bitmask_alloc(unsigned int n)
struct bitmask *bmp;

bmp = malloc(sizeof(*bmp));
if (bmp == 0)
if (!bmp)
return 0;
bmp->size = n;
bmp->maskp = calloc(longsperbits(n), sizeof(unsigned long));
if (bmp->maskp == 0) {
if (!bmp->maskp) {
free(bmp);
return 0;
}
@@ -40,7 +40,7 @@ struct bitmask *bitmask_alloc(unsigned int n)
/* Free `struct bitmask` */
void bitmask_free(struct bitmask *bmp)
{
if (bmp == 0)
if (!bmp)
return;
free(bmp->maskp);
bmp->maskp = (unsigned long *)0xdeadcdef; /* double free tripwire */

0 comments on commit 671be01

Please sign in to comment.