* re: drm/bridge: it6505: fix HDCP CTS compare V matching
@ 2025-01-07 9:31 Colin King (gmail)
2025-01-07 9:45 ` Hermes.Wu
0 siblings, 1 reply; 2+ messages in thread
From: Colin King (gmail) @ 2025-01-07 9:31 UTC (permalink / raw)
To: Hermes Wu
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, dri-devel, linux-kernel
Hi,
static analysis on Linux-next has found a potential issue with the
following commit:
commit 0989c02c7a5c887c70deafen80c64d0291624e1a7
Author: Hermes Wu <hermes.wu@ite.com.tw>
Date: Mon Dec 30 18:51:26 2024 +0800
drm/bridge: it6505: fix HDCP CTS compare V matching
The issue is as follows:
Source: drivers/gpu/drm/bridge/ite-it6505.c, function:
it6505_hdcp_part2_ksvlist_check:
for (i = 0; i < 5; i++) {
if (bv[i][3] != av[i][0] || bv[i][2] != av[i][1] ||
av[i][1] != av[i][2] || bv[i][0] != av[i][3])
break;
DRM_DEV_DEBUG_DRIVER(dev, "V' all match!! %d, %d",
retry, i);
return true;
}
in the above for-loop, only iteration with i = 0 is performed, either
the if statement breaks out of the loop if the condition is true or
we reach the return true statement. Both conditions means the loop is
never iterated, yet the loop is expected to iterate for 5 times. This
looks incorrect.
Colin
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: drm/bridge: it6505: fix HDCP CTS compare V matching
2025-01-07 9:31 drm/bridge: it6505: fix HDCP CTS compare V matching Colin King (gmail)
@ 2025-01-07 9:45 ` Hermes.Wu
0 siblings, 0 replies; 2+ messages in thread
From: Hermes.Wu @ 2025-01-07 9:45 UTC (permalink / raw)
To: colin.i.king
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, dri-devel, linux-kernel
Hi
>-----Original Message-----
>From: Colin King (gmail) <colin.i.king@gmail.com>
>Sent: Tuesday, January 7, 2025 5:31 PM
>To: Hermes Wu (吳佳宏) <Hermes.Wu@ite.com.tw>
>Cc: Andrzej Hajda <andrzej.hajda@intel.com>; Neil Armstrong <neil.armstrong@linaro.org>; Robert Foss <rfoss@kernel.org>; Laurent Pinchart <Laurent.pinchart@ideasonboard.com>; Jonas Karlman <jonas@kwiboo.se>; Jernej Skrabec <jernej.skrabec@gmail.com>; dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org
>Subject: re: drm/bridge: it6505: fix HDCP CTS compare V matching
>
>Hi,
>
>static analysis on Linux-next has found a potential issue with the following commit:
>
>commit 0989c02c7a5c887c70deafen80c64d0291624e1a7
>Author: Hermes Wu <hermes.wu@ite.com.tw>
>Date: Mon Dec 30 18:51:26 2024 +0800
>
> drm/bridge: it6505: fix HDCP CTS compare V matching
>
>
>The issue is as follows:
>
>Source: drivers/gpu/drm/bridge/ite-it6505.c, function:
>it6505_hdcp_part2_ksvlist_check:
>
> for (i = 0; i < 5; i++) {
> if (bv[i][3] != av[i][0] || bv[i][2] != av[i][1] ||
> av[i][1] != av[i][2] || bv[i][0] != av[i][3])
> break;
>
> DRM_DEV_DEBUG_DRIVER(dev, "V' all match!! %d, %d", retry, i);
> return true;
> }
It should check if the for loop reach i == 4 before return true.
I will fix it,
thanks
>
>in the above for-loop, only iteration with i = 0 is performed, either
>the if statement breaks out of the loop if the condition is true or
>we reach the return true statement. Both conditions means the loop is
>never iterated, yet the loop is expected to iterate for 5 times. This
>looks incorrect.
>
>Colin
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-07 9:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-07 9:31 drm/bridge: it6505: fix HDCP CTS compare V matching Colin King (gmail)
2025-01-07 9:45 ` Hermes.Wu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®