Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
snprintf(gr->name, sizeof(gr->name), "%s-Max", cfi->name);
break;
default:
+ free(gr);
return;
}
else if (dsi->mode == DISKSTAT_WR) {
snprintf(gr->name, sizeof(gr->name), "%s-Write-MB/s", dsi->name);
}
- else
+ else {
+ free(gr);
return;
+ }
gr->query_data = dsi;
gr->query_new_value = query_dsi_load;
}
else if (nic->mode == NIC_RSSI_DBM)
snprintf(gr->name, sizeof(gr->name), "%s-rssi", nic->name);
- else
+ else {
+ free(gr);
return;
+ }
gr->query_data = nic;
gr->query_new_value = query_nic_load;