Message ID | 20150812082302.GD16445@linux (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index bcbd92c3b717..650e92e2f2f0 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c @@ -1317,14 +1317,15 @@ static int _of_init_opp_table_v2(struct device *dev, /* We have opp-list node now, iterate over it and add OPPs */ for_each_available_child_of_node(opp_np, np) { - count++; - ret = _opp_add_static_v2(dev, np); if (ret) { dev_err(dev, "%s: Failed to add OPP, %d\n", __func__, ret); + if (!count) + goto put_opp_np; goto free_table; } + count++; } /* There should be one of more OPP defined */