mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
gallium/hud: close a previously opened handle
We're missing the closedir() to the matching opendir().
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 5a58323064)
This commit is contained in:
parent
5fa2b384f0
commit
e19ed2971f
3 changed files with 6 additions and 1 deletions
|
|
@ -225,6 +225,7 @@ hud_get_num_cpufreq(bool displayhelp)
|
|||
snprintf(fn, sizeof(fn), "%s/cpufreq/scaling_max_freq", basename);
|
||||
add_object(dp->d_name, fn, CPUFREQ_MAXIMUM, cpu_index);
|
||||
}
|
||||
closedir(dir);
|
||||
|
||||
if (displayhelp) {
|
||||
list_for_each_entry(struct cpufreq_info, cfi, &gcpufreq_list, list) {
|
||||
|
|
|
|||
|
|
@ -277,8 +277,10 @@ hud_get_num_disks(bool displayhelp)
|
|||
/* Add any partitions */
|
||||
struct dirent *dpart;
|
||||
DIR *pdir = opendir(basename);
|
||||
if (!pdir)
|
||||
if (!pdir) {
|
||||
closedir(dir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
while ((dpart = readdir(pdir)) != NULL) {
|
||||
/* Avoid 'lo' and '..' and '.' */
|
||||
|
|
@ -298,6 +300,7 @@ hud_get_num_disks(bool displayhelp)
|
|||
add_object_part(basename, dpart->d_name, DISKSTAT_WR);
|
||||
}
|
||||
}
|
||||
closedir(dir);
|
||||
|
||||
if (displayhelp) {
|
||||
list_for_each_entry(struct diskstat_info, dsi, &gdiskstat_list, list) {
|
||||
|
|
|
|||
|
|
@ -399,6 +399,7 @@ hud_get_num_nics(bool displayhelp)
|
|||
}
|
||||
|
||||
}
|
||||
closedir(dir);
|
||||
|
||||
list_for_each_entry(struct nic_info, nic, &gnic_list, list) {
|
||||
char line[64];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue