Re: [PATCH v3 04/10] mailbox: imx: use devm_of_platform_populate()
From: sashiko-bot
Date: Wed Jun 17 2026 - 03:04:57 EST
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The return value of devm_of_platform_populate() is ignored, leading to silent probe success even if child devices fail to populate, and breaking the intended cleanup on module removal.
--
commit 583b7f6c5d004040c54817c853b20be8858487ce
Author: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
mailbox: imx: use devm_of_platform_populate()
This commit transitions the driver to use the managed function
devm_of_platform_populate(). This is intended to ensure that populated
child devices are properly removed when the parent device is removed,
fixing an issue where module reloads could lead to "double devices".
> diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c
> --- a/drivers/mailbox/imx-mailbox.c
> +++ b/drivers/mailbox/imx-mailbox.c
> @@ -984,7 +984,7 @@ static int imx_mu_probe(struct platform_device *pdev)
> if (ret)
> goto err_out;
>
> - of_platform_populate(dev->of_node, NULL, NULL, dev);
> + devm_of_platform_populate(dev);
[Severity: High]
Should this code check the return value of devm_of_platform_populate()?
If the function fails and returns an error code, the devres cleanup action
is not registered, but imx_mu_probe() will still return 0. This could
lead to a situation where child devices silently fail to populate, and any
partially populated devices would not be cleaned up on module removal.
For example:
ret = devm_of_platform_populate(dev);
if (ret)
goto err_out;
>
> return 0;
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260617-imx_mbox_rproc-v3-0-77948112defc@xxxxxxxxxxxxx?part=4