Fix pcf_sdd_value() return check

This commit is contained in:
Rodrigo Arias 2023-03-24 19:25:35 +01:00 committed by Rodrigo Arias Mallo
parent cc09920c80
commit 881e556e06

View File

@ -249,16 +249,16 @@ model_nanos6_breakdown_finish(struct emu *emu,
/* Emit subsystem values */
for (v = labels[CH_SUBSYSTEM]; v->label; v++) {
if (pcf_add_value(pcftype, v->value, v->label) != 0) {
err("pcf_add_value failed");
if (pcf_add_value(pcftype, v->value, v->label) == NULL) {
err("pcf_add_value ss failed");
return -1;
}
}
/* Emit idle values */
for (v = labels[CH_IDLE]; v->label; v++) {
if (pcf_add_value(pcftype, v->value, v->label) != 0) {
err("pcf_add_value failed");
if (pcf_add_value(pcftype, v->value, v->label) == NULL) {
err("pcf_add_value idle failed");
return -1;
}
}