dev_err(dev, "%s: Failed to add OPP, %d\n", __func__,
ret);
of_node_put(np);
- return ret;
+ goto put_list_kref;
} else if (opp) {
count++;
}
}
/* There should be one of more OPP defined */
- if (WARN_ON(!count))
- return -ENOENT;
+ if (WARN_ON(!count)) {
+ ret = -ENOENT;
+ goto put_list_kref;
+ }
list_for_each_entry(opp, &opp_table->opp_list, node)
pstate_count += !!opp->pstate;
if (pstate_count && pstate_count != count) {
dev_err(dev, "Not all nodes have performance state set (%d: %d)\n",
count, pstate_count);
- return -ENOENT;
+ ret = -ENOENT;
+ goto put_list_kref;
}
if (pstate_count)
opp_table->parsed_static_opps = true;
return 0;
+
+put_list_kref:
+ _put_opp_list_kref(opp_table);
+
+ return ret;
}
/* Initializes OPP tables based on old-deprecated bindings */
if (ret) {
dev_err(dev, "%s: Failed to add OPP %ld (%d)\n",
__func__, freq, ret);
+ _put_opp_list_kref(opp_table);
return ret;
}
nr -= 2;