fix: add missing closedir in _get_max_cpuid_from_sysfs()
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 29 Jul 2022 15:12:57 +0000 (11:12 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 29 Jul 2022 15:18:37 +0000 (11:18 -0400)
commit74bf291987baaaf2a35ff2b0dc982422ecf4ff3c
tree5fbf88d9a71be095f6404765994ff4043c6a9b1b
parent844f3f2f682240f9bc37554eb947e49c428e57f0
fix: add missing closedir in _get_max_cpuid_from_sysfs()

As reported by Coverity:

*** CID 1490849:    (RESOURCE_LEAK)
/src/common/smp.c: 84 in _get_max_cpuid_from_sysfs()
78       * CPU num of 0.
79       */
80      if (max_cpuid < 0 || max_cpuid > INT_MAX)
81      max_cpuid = -1;
82
83     end:
>>>     CID 1490849:    (RESOURCE_LEAK)
>>>     Variable "cpudir" going out of scope leaks the storage it points to.
84      return max_cpuid;
85     }
86
87     /*
88      * As a fallback to parsing the CPU mask in "/sys/devices/system/cpu/possible",
89      * iterate on all the folders in "/sys/devices/system/cpu" that start with

Change-Id: I2048e2473d66aaa2a275fe2923da84a7e105f235
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/common/smp.c
This page took 0.024971 seconds and 4 git commands to generate.