disp: msm: sde: fix out of bounds memory access

Change-Id: I74324fc1032086ac4362a059a9f76a6dcdc19193
Signed-off-by: Saurabh Yadav <quic_sauyad@quicinc.com>
This commit is contained in:
Saurabh Yadav
2023-05-05 00:09:17 -07:00
parent 8722b154e7
commit 8f73dc7e9d

View File

@@ -1142,7 +1142,7 @@ int reset_v1(struct sde_hw_ctl *ctl)
struct sde_hw_blk_reg_map hw;
u32 val, i = 0, k = 0;
if (!ctl || ctl->idx > CTL_MAX) {
if (!ctl || ctl->idx >= CTL_MAX) {
DRM_ERROR("invalid ctl %pK ctl idx %d\n",
ctl, ((ctl) ? ctl->idx : 0));
return -EINVAL;