• P
    cpupower tools: Fix malloc of cpu_info structure · 35a16973
    Palmer Cox 提交于
    The cpu_info member of cpupower_topology was being declared as an unnamed
    structure. This member was then being malloced using the size of the
    parent cpupower_topology * the number of cpus. This works
    because cpu_info is smaller than cpupower_topology. However, there is
    no guarantee that will always be the case. Making cpu_info its own
    top level structure (named cpuid_core_info) allows for mallocing the actual
    size of this structure. This also lets us get rid of a redefinition of
    the structure in topology.c with slightly different field names.
    Signed-off-by: NPalmer Cox <p@lmercox.com>
    Signed-off-by: NThomas Renninger <trenn@suse.de>
    Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
    35a16973
topology.c 2.9 KB