re: drm/bridge: it6505: fix HDCP CTS compare V matching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

static analysis on Linux-next has found a potential issue with the following commit:

commit 0989c02c7a5c887c70deafen80c64d0291624e1a7
Author: Hermes Wu <hermes.wu@xxxxxxxxxx>
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






[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux