HI, sorry for delay with review. On Fri, Oct 18, 2024 at 04:13:35PM GMT, Anjali K wrote: > /* add @set to the @ary, unnecessary set is deallocated. */ > -static int add_cpuset_to_array(cpu_set_t **ary, size_t *items, cpu_set_t *set, size_t setsize) > +static int add_cpuset_to_array(cpu_set_t **ary, size_t *items, cpu_set_t *set, size_t setsize, int maxcpus) > { > + cpu_set_t *common_cpus_set; > size_t i; > > if (!ary) > return -EINVAL; > > + common_cpus_set = CPU_ALLOC(maxcpus); > + if (!common_cpus_set) > + return -EINVAL; Would be better to allocate this only once in cputype_read_topology() and reuse it for all the arrays and CPUs? The rest looks good. Thanks! Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com