Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Bartosz Golaszewski" <bartosz.golaszewski@oss.qualcomm.com>
Cc: imx@lists.linux.dev, Frank.Li@kernel.org, lee@kernel.org,
	mfd@lists.linux.dev
Subject: Re: [PATCH 6/8] mfd: tps6586: use platform_device_set_fwnode()
Date: Tue, 21 Jul 2026 09:26:02 +0000	[thread overview]
Message-ID: <20260721092603.42BB41F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260720-pdev-set-fwnode-instead-of-of-node-v1-6-2dee93f42c54@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [Low] The commit message uses non-standard capitalization for the description, violating MFD subsystem prefix rules.

Pre-existing issues:
- [High] Manual assignment of `pdev->dev.platform_data` bypasses `platform_device_add_data()`, causing a bad free and kernel panic during device release.
--

--- Patch [6]: [PATCH 6/8] mfd: tps6586: use platform_device_set_fwnode() ---
commit 0c67148d3505d89af495783abc48f5f8ff3075d3
Author: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

mfd: tps6586: use platform_device_set_fwnode()

This commit updates the tps6586 driver to prefer the higher-level
platform_device_set_fwnode() over the OF-specific
platform_device_set_of_node() for dynamically allocated platform devices.

> mfd: tps6586: use platform_device_set_fwnode()

[Severity: Low]
This isn't a bug, but should the description after the subsystem prefix
be capitalized?

The MFD subsystem guidelines dictate always capitalizing the description
after the subsystem prefix for MFD, LED, and Backlight subsystems.

> diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
> --- a/drivers/mfd/tps6586x.c
> +++ b/drivers/mfd/tps6586x.c

[ ... ]

> @@ -397,7 +397,7 @@ static int tps6586x_add_subdevs(struct tps6586x *tps6586x,
>  
>  		pdev->dev.parent = tps6586x->dev;
>  		pdev->dev.platform_data = subdev->platform_data;

[Severity: High]
This is a pre-existing issue, but does assigning the platform_data pointer
directly like this cause a bad free and kernel panic during device release?

When platform_device_release() is called, either due to a failure in
platform_device_add() or when the device is unregistered later, it
unconditionally calls kfree() on the platform_data pointer.

Since subdev->platform_data is typically statically allocated by board files
rather than dynamically allocated by the platform bus, bypassing the proper
duplication handled by platform_device_add_data() can lead to a crash.

> -		platform_device_set_of_node(pdev, subdev->of_node);
> +		platform_device_set_fwnode(pdev, of_fwnode_handle(subdev->of_node));
>  
>  		ret = platform_device_add(pdev);
>  		if (ret) {

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260720-pdev-set-fwnode-instead-of-of-node-v1-0-2dee93f42c54@oss.qualcomm.com?part=6

  reply	other threads:[~2026-07-21  9:26 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20  9:24 [PATCH 0/8] driver core: prefer platform_device_set_fwnode() Bartosz Golaszewski
2026-07-20  9:24 ` [PATCH 1/8] powerpc/powermac: use platform_device_set_fwnode() Bartosz Golaszewski
2026-07-21  9:25   ` sashiko-bot
2026-07-20  9:24 ` [PATCH 2/8] i2c: pxa-pci: " Bartosz Golaszewski
2026-07-20  9:41   ` Wolfram Sang
2026-07-21  9:26   ` sashiko-bot
2026-07-20  9:24 ` [PATCH 3/8] iommu/fsl: " Bartosz Golaszewski
2026-07-20 12:58   ` Robin Murphy
2026-07-20 13:39     ` Bartosz Golaszewski
2026-07-20 14:34       ` Robin Murphy
2026-07-20 14:34   ` Frank Li
2026-07-21  9:26   ` sashiko-bot
2026-07-20  9:24 ` [PATCH 4/8] net: bcmgenet: " Bartosz Golaszewski
2026-07-20 14:38   ` Andrew Lunn
2026-07-20 16:57     ` Florian Fainelli
2026-07-21  9:26   ` sashiko-bot
2026-07-20  9:24 ` [PATCH 5/8] pmdomain: imx: " Bartosz Golaszewski
2026-07-20 14:34   ` Frank Li
2026-07-21  9:26   ` sashiko-bot
2026-07-20  9:24 ` [PATCH 6/8] mfd: tps6586: " Bartosz Golaszewski
2026-07-21  9:26   ` sashiko-bot [this message]
2026-07-20  9:24 ` [PATCH 7/8] net: mv643xx: " Bartosz Golaszewski
2026-07-20 14:43   ` Andrew Lunn
2026-07-20 16:01     ` Bartosz Golaszewski
2026-07-20 18:28       ` Andrew Lunn
2026-07-21  7:57         ` Bartosz Golaszewski
2026-07-21  9:26   ` sashiko-bot
2026-07-20  9:24 ` [PATCH 8/8] slimbus: qcom-ngd-ctrl: " Bartosz Golaszewski
2026-07-21  9:26   ` sashiko-bot

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=20260721092603.42BB41F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=imx@lists.linux.dev \
    --cc=lee@kernel.org \
    --cc=mfd@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    /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