mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: "Christian Kohlschütter" <christian@kohlschutter.com>
Cc: "Liam Girdwood" <lgirdwood@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"Robin Murphy" <robin.murphy@arm.com>,
	wens@kernel.org, "Heiko Stübner" <heiko@sntech.de>,
	"Markus Reichl" <m.reichl@fivetechno.de>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	"Linux MMC List" <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH] regulator: core: Resolve supply name earlier to prevent double-init
Date: Thu, 21 Jul 2022 16:01:17 +0100	[thread overview]
Message-ID: <YtlqPbbBceBmekcV@sirena.org.uk> (raw)
In-Reply-To: <3B4AE882-0C28-41E3-9466-F8E301567627@kohlschutter.com>

[-- Attachment #1: Type: text/plain, Size: 990 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2022-07-21 15:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 20:32 Christian Kohlschütter
2022-07-15 20:51 ` Christian Kohlschütter
2022-07-21 15:01 ` Mark Brown [this message]
2022-07-22 17:42   ` [PATCH v2] " Christian Kohlschütter
     [not found]     ` <166083617547.142744.6260121456450934801.b4-ty@kernel.org>
2022-10-28 16:59       ` Christian Kohlschütter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YtlqPbbBceBmekcV@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=christian@kohlschutter.com \
    --cc=heiko@sntech.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=m.reichl@fivetechno.de \
    --cc=robin.murphy@arm.com \
    --cc=wens@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®