On Thu, May 23, 2019 at 01:41:19PM -0700, kan.li...@linux.intel.com wrote:

SNIP

> @@ -88,7 +138,7 @@ static int build_cpu_topology(struct cpu_topology *tp, int 
> cpu)
>       return ret;
>  }
>  
> -void cpu_topology__delete(struct cpu_topology *tp)
> +void cpu_topology__delete(struct cpu_topology *tp, bool has_die)
>  {
>       u32 i;
>  
> @@ -98,17 +148,22 @@ void cpu_topology__delete(struct cpu_topology *tp)
>       for (i = 0 ; i < tp->core_sib; i++)
>               zfree(&tp->core_siblings[i]);
>  
> +     if (has_die) {

I think there's no need for has_die check in here,
tp->die_sib will be zero, and also will tp->die_siblings[i]

jirka

> +             for (i = 0 ; i < tp->die_sib; i++)
> +                     zfree(&tp->die_siblings[i]);
> +     }
> +
>       for (i = 0 ; i < tp->thread_sib; i++)
>               zfree(&tp->thread_siblings[i]);
>  
>       free(tp);
>  }

SNIP

Reply via email to