Messages in this thread | | | Date | Thu, 21 Jul 2022 16:01:17 +0100 | From | Mark Brown <> | Subject | Re: [PATCH] regulator: core: Resolve supply name earlier to prevent double-init |
| |
On Fri, Jul 15, 2022 at 10:32:16PM +0200, Christian Kohlschütter wrote: > Previously, an unresolved regulator supply reference upon calling > regulator_register on an always-on or boot-on regulator caused > set_machine_constraints to be called twice.
One small thing below but otherwise I think this should be fine, however since we're very near the merge window I'd rather hold off any apply at -rc1, just to give more time for things to get tested.
> - /* set regulator constraints */ > - if (init_data) > - rdev->constraints = kmemdup(&init_data->constraints, > - sizeof(*rdev->constraints), > - GFP_KERNEL); > - else > - rdev->constraints = kzalloc(sizeof(*rdev->constraints), > - GFP_KERNEL); > if (!rdev->constraints) { > ret = -ENOMEM; > goto wash; > }
The check for allocation failure should get pulled earlier in the function along with the allocation, no sense in doing any of the other work if we're going to fail. [unhandled content-type:application/pgp-signature] | |