From: sashiko-bot@kernel.org
To: "Atanas Filipov" <atanas.filipov@oss.qualcomm.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v4 1/5] media: qcom: camss: Populate CAMSS child devices via DT
Date: Mon, 06 Jul 2026 07:23:17 +0000 [thread overview]
Message-ID: <20260706072317.E807C1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260706071113.383215-2-atanas.filipov@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The return value of `devm_of_platform_populate()` is silently ignored, potentially leaving the subsystem in a broken state without propagating the error.
- [High] Incorrect devres ordering causes child devices to be populated prematurely and depopulated too late, leading to hardware faults and Use-After-Free during teardown.
--
commit 87e3279291715684d9b1d07a1326244dc96aa857
Author: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
media: qcom: camss: Populate CAMSS child devices via DT
Use devm_of_platform_populate() so that child nodes declared under the
CAMSS device tree node (e.g. OPE) are automatically instantiated as
platform devices.
> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> index 2123f6388e3d7..95e655a8b6aa0 100644
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
[ ... ]
> @@ -5362,6 +5363,8 @@ static int camss_probe(struct platform_device *pdev)
> if (!camss)
> return -ENOMEM;
>
> + devm_of_platform_populate(dev);
[Severity: High]
Does this code silently ignore initialization errors?
If devm_of_platform_populate() fails, the driver proceeds without propagating
the error. This could leave the required child devices unpopulated and the
camera subsystem in a partially initialized and functionally broken state.
Should the return value be checked here?
[Severity: High]
Could calling devm_of_platform_populate() this early in probe cause hardware
faults or use-after-free during driver teardown?
Because devm_of_platform_populate() is called at the very beginning of
camss_probe(), its devres cleanup (of_platform_depopulate()) is pushed to the
bottom of the LIFO devres stack and runs last.
During driver removal, camss_remove() manually disables PM runtime and
destroys power domains via camss_genpd_cleanup() before the devres cleanup
unregisters the child devices.
This leaves a teardown window where the child video devices remain fully
registered and active while the parent's resources, memory, and power domains
are completely destroyed. If userspace accesses the child video device during
this window, will it interact with unpowered or freed parent hardware?
> +
> camss->res = of_device_get_match_data(dev);
>
> atomic_set(&camss->ref_count, 0);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260706071113.383215-1-atanas.filipov@oss.qualcomm.com?part=1
next prev parent reply other threads:[~2026-07-06 7:23 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 7:11 [PATCH v4 0/5] Add Qualcomm JPEG V4L2 encoder for SM8250 Atanas Filipov
2026-07-06 7:11 ` [PATCH v4 1/5] media: qcom: camss: Populate CAMSS child devices via DT Atanas Filipov
2026-07-06 7:23 ` sashiko-bot [this message]
2026-07-06 12:09 ` Krzysztof Kozlowski
2026-07-06 12:27 ` Bryan O'Donoghue
2026-07-06 12:36 ` Krzysztof Kozlowski
2026-07-06 12:38 ` Bryan O'Donoghue
2026-07-06 12:41 ` Dmitry Baryshkov
2026-07-06 7:11 ` [PATCH v4 2/5] dt-bindings: media: qcom,sm8250-camss: allow JPEG encoder child node Atanas Filipov
2026-07-06 7:24 ` sashiko-bot
2026-07-06 10:07 ` Bryan O'Donoghue
2026-07-06 12:11 ` Krzysztof Kozlowski
2026-07-06 7:11 ` [PATCH v4 3/5] dt-bindings: media: qcom: Add JPEG encoder binding Atanas Filipov
2026-07-06 7:18 ` sashiko-bot
2026-07-06 10:19 ` Bryan O'Donoghue
2026-07-06 12:17 ` Krzysztof Kozlowski
2026-07-06 7:11 ` [PATCH v4 4/5] arm64: dts: qcom: sm8250: Add JPEG encoder node Atanas Filipov
2026-07-06 7:29 ` sashiko-bot
2026-07-06 12:18 ` Krzysztof Kozlowski
2026-07-06 12:45 ` Dmitry Baryshkov
2026-07-06 7:11 ` [PATCH v4 5/5] media: qcom: jpeg: Add Qualcomm JPEG V4L2 encoder Atanas Filipov
2026-07-06 7:33 ` sashiko-bot
2026-07-06 7:46 ` Vladimir Zapolskiy
2026-07-06 10:21 ` Bryan O'Donoghue
2026-07-06 12:19 ` Krzysztof Kozlowski
2026-07-06 13:11 ` Dmitry Baryshkov
2026-07-06 17:13 ` Uwe Kleine-König
2026-07-06 10:12 ` [PATCH v4 0/5] Add Qualcomm JPEG V4L2 encoder for SM8250 Bryan O'Donoghue
2026-07-06 12:00 ` Vladimir Zapolskiy
2026-07-06 12:11 ` Bryan O'Donoghue
2026-07-06 13:02 ` Vladimir Zapolskiy
2026-07-06 13:37 ` Bryan O'Donoghue
2026-07-06 13:57 ` Vladimir Zapolskiy
2026-07-06 14:12 ` Bryan O'Donoghue
2026-07-06 14:35 ` Vladimir Zapolskiy
2026-07-06 14:49 ` Bryan O'Donoghue
2026-07-06 15:00 ` Vladimir Zapolskiy
2026-07-06 12:24 ` Krzysztof Kozlowski
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=20260706072317.E807C1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=atanas.filipov@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--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