intel/numatop

function ll_init() is not initializing some fields in cfg

Opened this issue · 1 comments

In common/os/os_perf.c function ll_init() is declaring cfg on the stack and then assigning conf from some uninitialized fields in cfg namely:

 839        conf->type = cfg.type;
 840        conf->config = (cfg.config) | (cfg.other_attr << 16);
 841        conf->config1 = cfg.extra_value;

Should cfg be memset before calling plat_ll_config?

Same kind of issue in profiling_init too with cfg fields:

 805        for (i = 0; i < PERF_COUNT_NUM; i++) {
 806                plat_profiling_config(i, &cfg);
 807                conf_arr[i].perf_count_id = i;
 808                conf_arr[i].type = cfg.type;