From: sashiko-bot@kernel.org
To: "Chaoyi Chen" <kernel@airkyi.com>
Cc: olteanv@gmail.com, neil.armstrong@linaro.org,
linux-phy@lists.infradead.org, vkoul@kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 4/5] drm/rockchip: cdn-dp: Support handle lane info without extcon
Date: Mon, 08 Jun 2026 07:22:51 +0000 [thread overview]
Message-ID: <20260608072251.D16521F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260608070805.88-5-kernel@airkyi.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Incorrect extcon pointer validation logic skips valid extcon devices
--
commit a9e1ff8879a685d4cf4ae0348e11004c03d1dc46
Author: Chaoyi Chen <chaoyi.chen@rock-chips.com>
drm/rockchip: cdn-dp: Support handle lane info without extcon
This commit adds support for getting PHY lane info without the help of extcon
when the Type-C controller is present. It updates multiple functions to verify
the extcon device pointer before using it.
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> index 177e30445ee83..9068118859e21 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
[ ... ]
> @@ -1121,14 +1130,14 @@ static int cdn_dp_probe(struct platform_device *pdev)
> PTR_ERR(phy) == -EPROBE_DEFER)
> return -EPROBE_DEFER;
>
> - if (IS_ERR(extcon) || IS_ERR(phy))
> + if (IS_ERR(phy) || PTR_ERR(extcon) != -ENODEV)
> continue;
[Severity: High]
Does this logic skip valid extcon devices?
When extcon_get_edev_by_phandle() returns a valid pointer, PTR_ERR(extcon)
evaluates to the pointer's memory address, which will not equal -ENODEV.
This causes the condition to evaluate to true, executing the continue
statement and bypassing initialization for boards that rely on a valid
extcon device.
>
> port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
> if (!port)
> return -ENOMEM;
>
> - port->extcon = extcon;
> + port->extcon = IS_ERR(extcon) ? NULL : extcon;
> port->phy = phy;
> port->dp = dp;
> port->id = i;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260608070805.88-1-kernel@airkyi.com?part=4
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Chaoyi Chen" <kernel@airkyi.com>
Cc: olteanv@gmail.com, neil.armstrong@linaro.org,
linux-phy@lists.infradead.org, vkoul@kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 4/5] drm/rockchip: cdn-dp: Support handle lane info without extcon
Date: Mon, 08 Jun 2026 07:22:51 +0000 [thread overview]
Message-ID: <20260608072251.D16521F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260608070805.88-5-kernel@airkyi.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Incorrect extcon pointer validation logic skips valid extcon devices
--
commit a9e1ff8879a685d4cf4ae0348e11004c03d1dc46
Author: Chaoyi Chen <chaoyi.chen@rock-chips.com>
drm/rockchip: cdn-dp: Support handle lane info without extcon
This commit adds support for getting PHY lane info without the help of extcon
when the Type-C controller is present. It updates multiple functions to verify
the extcon device pointer before using it.
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> index 177e30445ee83..9068118859e21 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
[ ... ]
> @@ -1121,14 +1130,14 @@ static int cdn_dp_probe(struct platform_device *pdev)
> PTR_ERR(phy) == -EPROBE_DEFER)
> return -EPROBE_DEFER;
>
> - if (IS_ERR(extcon) || IS_ERR(phy))
> + if (IS_ERR(phy) || PTR_ERR(extcon) != -ENODEV)
> continue;
[Severity: High]
Does this logic skip valid extcon devices?
When extcon_get_edev_by_phandle() returns a valid pointer, PTR_ERR(extcon)
evaluates to the pointer's memory address, which will not equal -ENODEV.
This causes the condition to evaluate to true, executing the continue
statement and bypassing initialization for boards that rely on a valid
extcon device.
>
> port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
> if (!port)
> return -ENOMEM;
>
> - port->extcon = extcon;
> + port->extcon = IS_ERR(extcon) ? NULL : extcon;
> port->phy = phy;
> port->dp = dp;
> port->id = i;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260608070805.88-1-kernel@airkyi.com?part=4
next prev parent reply other threads:[~2026-06-08 7:22 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 7:08 [PATCH 0/5] drm/bridge: Implement generic USB Type-C DP HPD bridge Chaoyi Chen
2026-06-08 7:08 ` Chaoyi Chen
2026-06-08 7:08 ` Chaoyi Chen
2026-06-08 7:08 ` [PATCH 1/5] " Chaoyi Chen
2026-06-08 7:08 ` Chaoyi Chen
2026-06-08 7:08 ` Chaoyi Chen
2026-06-08 7:22 ` sashiko-bot
2026-06-08 7:22 ` sashiko-bot
2026-06-08 7:08 ` [PATCH 2/5] drm/bridge: aux: Add drm_aux_bridge_register_from_node() Chaoyi Chen
2026-06-08 7:08 ` Chaoyi Chen
2026-06-08 7:08 ` Chaoyi Chen
2026-06-08 7:17 ` sashiko-bot
2026-06-08 7:17 ` sashiko-bot
2026-06-08 7:08 ` [PATCH 3/5] phy: rockchip: phy-rockchip-typec: Add DRM AUX bridge Chaoyi Chen
2026-06-08 7:08 ` Chaoyi Chen
2026-06-08 7:08 ` Chaoyi Chen
2026-06-08 7:24 ` sashiko-bot
2026-06-08 7:24 ` sashiko-bot
2026-06-08 7:08 ` [PATCH 4/5] drm/rockchip: cdn-dp: Support handle lane info without extcon Chaoyi Chen
2026-06-08 7:08 ` Chaoyi Chen
2026-06-08 7:08 ` Chaoyi Chen
2026-06-08 7:22 ` sashiko-bot [this message]
2026-06-08 7:22 ` sashiko-bot
2026-06-08 7:08 ` [PATCH 5/5] drm/rockchip: cdn-dp: Add multiple bridges to support PHY port selection Chaoyi Chen
2026-06-08 7:08 ` Chaoyi Chen
2026-06-08 7:08 ` Chaoyi Chen
2026-06-08 7:22 ` sashiko-bot
2026-06-08 7:22 ` sashiko-bot
-- strict thread matches above, loose matches on Subject: below --
2026-05-21 3:28 [PATCH 0/5] drm/bridge: Implement generic USB Type-C DP HPD bridge Chaoyi Chen
2026-05-21 3:28 ` [PATCH 4/5] drm/rockchip: cdn-dp: Support handle lane info without extcon Chaoyi Chen
2026-05-21 3:28 ` Chaoyi Chen
2026-05-21 3:28 ` Chaoyi Chen
2026-05-21 5:49 ` 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=20260608072251.D16521F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@airkyi.com \
--cc=linux-phy@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=olteanv@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vkoul@kernel.org \
/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.