[PATCH v2 4/6] regulator: allow use of dummy regulator

Trent Piepho trent.piepho at igorinstitute.com
Fri Nov 19 02:49:58 PST 2021


On Fri, Nov 19, 2021 at 1:55 AM Andrej Picej <andrej.picej at norik.com> wrote:
>
>         ret = of_device_ensure_probed(node);
> -       if (ret)
> +       if (ret) {
> +               /*
> +                * If "barebox,allow-dummy-supply" property is set for regulator
> +                * provider allow use of dummy regulator (NULL is returned).
> +                * Check regulator node and its parent if this setting is set
> +                * PMIC wide.
> +                */
> +               node_parent = of_get_parent(node);
> +               if (of_get_property(node, "barebox,allow-dummy-supply", NULL) ||
> +                   of_get_property(node_parent, "barebox,allow-dummy-supply", NULL)) {
> +                       dev_dbg(dev, "Allow use of dummy regulator for " \
> +                               "%s-supply\n", supply);
> +                       ri = NULL;
> +                       goto out;
> +               }
> +
>                 return ERR_PTR(ret);

This return, which was added in "common: add initial barebox
deep-probe support", is a memory leak of propname.  It should be goto
out.



More information about the barebox mailing list