All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Nihal Kumar Gupta" <nihal.gupta@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	media-ci@linuxtv.org
Subject: Re: [PATCH v5 2/2] media: qcom: camss: Add Glymur-specific resources
Date: Thu, 03 Dec 2026 17:06:45 +0000	[thread overview]
Message-ID: <sashiko-outbox-248237@kernel.org> (raw)
In-Reply-To: <20261203-glymur_camss-v5-2-960a6030ca6b@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] media: qcom: camss: NULL deref in
  msm_csiphy_subdev_init_legacy() on Glymur
--

commit e587f871cdd9e6a0077c83e75057c1e3daa0a4ae
Author: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>

media: qcom: camss: Add Glymur-specific resources

This commit adds Glymur-specific CSIPHY and CAMSS resource tables for the
three CSIPHY instances on Glymur and updates the qcom,glymur-camss match
entry to use them instead of x1e80100_resources.

> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> index 3a5b7c665d3a9..189f4bada15a0 100644
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
> @@ -4529,6 +4529,13 @@ static const struct resources_icc icc_res_sa8775p[] = {
>  	},
>  };
>  
> +static const struct camss_subdev_resources csiphy_res_glymur[] = {
> +	/* CSIPHY0 CSIPHY1 CSIPHY4 */
> +	{ CAMSS_CSIPHY_RES_PHY_API(0, &csiphy_formats_sdm845), },
> +	{ CAMSS_CSIPHY_RES_PHY_API(1, &csiphy_formats_sdm845), },
> +	{ CAMSS_CSIPHY_RES_PHY_API(4, &csiphy_formats_sdm845), },
> +};

[Severity: High]
Can this cause a NULL pointer dereference on csiphy->res->hw_ops during
probe when no remote PHY endpoint is connected?

CAMSS_CSIPHY_RES_PHY_API() leaves .csiphy.hw_ops as NULL, while
camss_detect_legacy_phy() sets camss->legacy_phy = !!camss->res->csiphy_res
and only clears it if an endpoint resolves to a remote node named "phy".

On a Glymur device tree with no connected remote "phy" endpoint (such as
TPG-only operation with an empty ports node), camss->legacy_phy stays true.
camss_init_subdevices() then calls msm_csiphy_subdev_init_legacy(), which
dereferences csiphy->res->hw_ops->init(csiphy) and crashes during probe.

Before this change, x1e80100_resources populated .hw_ops, so this path
failed cleanly with -EINVAL. Should camss_detect_legacy_phy() check that
hw_ops is non-NULL before enabling legacy mode?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203-glymur_camss-v5-0-960a6030ca6b@oss.qualcomm.com?part=2

      parent reply	other threads:[~2026-12-03 17:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 16:21 [PATCH v5 0/2] media: qcom: camss: Fix Glymur CSIPHY topology Nihal Kumar Gupta
2026-12-03 16:21 ` [PATCH v5 1/2] dt-bindings: media: qcom,glymur-camss: Use linear CSI ports Nihal Kumar Gupta
2026-12-03 16:48   ` Bryan O'Donoghue
2026-12-03 16:21 ` [PATCH v5 2/2] media: qcom: camss: Add Glymur-specific resources Nihal Kumar Gupta
2026-12-03 16:49   ` Bryan O'Donoghue
2026-12-03 17:06   ` sashiko-bot [this message]

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=sashiko-outbox-248237@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=media-ci@linuxtv.org \
    --cc=nihal.gupta@oss.qualcomm.com \
    --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 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.