if (!tree)
return;
+ free_widget_node(tree->afg, &widget_afg_group);
if (tree->nodes) {
for (p = tree->nodes; *p; p++)
free_widget_node(*p, &widget_node_group);
kfree(tree->nodes);
}
- free_widget_node(tree->afg, &widget_afg_group);
if (tree->root)
kobject_put(tree->root);
kfree(tree);
if (!tree->root)
return -ENOMEM;
- if (codec->afg) {
- err = add_widget_node(tree->root, codec->afg,
- &widget_afg_group, &tree->afg);
- if (err < 0)
- return err;
- }
-
tree->nodes = kcalloc(codec->num_nodes + 1, sizeof(*tree->nodes),
GFP_KERNEL);
if (!tree->nodes)
return err;
}
+ if (codec->afg) {
+ err = add_widget_node(tree->root, codec->afg,
+ &widget_afg_group, &tree->afg);
+ if (err < 0)
+ return err;
+ }
+
kobject_uevent(tree->root, KOBJ_CHANGE);
return 0;
}