On 28/11/2024 09:02, Vladimir Zapolskiy wrote:
+ np = of_changeset_create_node(ocs, dev->of_node, node_name);
+ if (!np) {
+ dev_err(dev, "Unable to create new node\n");
+ return -ENODEV;
Leaked reference to np.
I don't believe that's a leak, because you only release np when it is
non-NULL.
+ }
+
+ ret = of_changeset_add_prop_string(ocs, np, "compatible", compat);
+ if (ret)
+ dev_err(dev, "unable to add %s\n", compat);
+
+ of_node_put(np);
Which we do here.
However, I think I have missed a of_changeset_destroy(ocs); on the error
path.
@ref drivers/pci/of.c::of_pci_make_dev_node()
---
bod