All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Tian Xuechen <202300460064@mail.sdu.edu.cn>
Cc: aaro.koskinen@iki.fi, andreas@kemnade.info, khilman@baylibre.com,
	rogerq@kernel.org, tony@atomide.com, j-keerthy@ti.com,
	mfd@lists.linux.dev, linux-omap@vger.kernel.org,
	liguangshuo@mail.sdu.edu.cn
Subject: Re: [PATCH 1/2] mfd: lp873x: Remove the child devices on unbind
Date: Wed, 2 Dec 2026 16:26:49 +0000	[thread overview]
Message-ID: <20261202162649.GL43081@kernel.org> (raw)
In-Reply-To: <20261126132803.4091137-2-202300460064@mail.sdu.edu.cn>

On Thu, 26 Nov 2026, Tian Xuechen wrote:

> From: Tian Xuechen <202300460064@mail.sdu.edu.cn>
> 
> The regulator and GPIO children stay registered when the I2C driver
> is unbound, although they use the parent's managed data. Use managed
> MFD registration so the children are removed first.
> 
> This issue was found by our static analysis tool under development.
> 
> Fixes: dc21c7ad3a8a ("mfd: lp873x: Add lp873x PMIC support")
> Signed-off-by: Tian Xuechen <202300460064@mail.sdu.edu.cn>
> ---
>  drivers/mfd/lp873x.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/lp873x.c b/drivers/mfd/lp873x.c
> index ab7bd46d9ff7..6b2badab4f2d 100644
> --- a/drivers/mfd/lp873x.c
> +++ b/drivers/mfd/lp873x.c
> @@ -53,8 +53,8 @@ static int lp873x_probe(struct i2c_client *client)
>  
>  	i2c_set_clientdata(client, lp873);
>  
> -	ret = mfd_add_devices(lp873->dev, PLATFORM_DEVID_AUTO, lp873x_cells,
> -			      ARRAY_SIZE(lp873x_cells), NULL, 0, NULL);
> +	ret = devm_mfd_add_devices(lp873->dev, PLATFORM_DEVID_AUTO, lp873x_cells,
> +				   ARRAY_SIZE(lp873x_cells), NULL, 0, NULL);
>  
>  	return ret;

Same here.

-- 
Lee Jones

  reply	other threads:[~2026-12-02 16:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 13:28 [PATCH 0/2] mfd: Remove LP873x and TPS65218 child devices on teardown Tian Xuechen
2026-11-26 13:28 ` [PATCH 1/2] mfd: lp873x: Remove the child devices on unbind Tian Xuechen
2026-12-02 16:26   ` Lee Jones [this message]
2026-11-26 13:28 ` [PATCH 2/2] mfd: tps65218: Fix potential use-after-free by child devices Tian Xuechen
2026-12-02 16:26   ` Lee Jones

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=20261202162649.GL43081@kernel.org \
    --to=lee@kernel.org \
    --cc=202300460064@mail.sdu.edu.cn \
    --cc=aaro.koskinen@iki.fi \
    --cc=andreas@kemnade.info \
    --cc=j-keerthy@ti.com \
    --cc=khilman@baylibre.com \
    --cc=liguangshuo@mail.sdu.edu.cn \
    --cc=linux-omap@vger.kernel.org \
    --cc=mfd@lists.linux.dev \
    --cc=rogerq@kernel.org \
    --cc=tony@atomide.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.