[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220330120246.25580-5-xiam0nd.tong@gmail.com>
Date: Wed, 30 Mar 2022 20:02:45 +0800
From: Xiaomeng Tong <xiam0nd.tong@...il.com>
To: patrik.r.jakobsson@...il.com, airlied@...ux.ie, daniel@...ll.ch
Cc: rob@...com, yakui.zhao@...el.com, airlied@...hat.com,
alan@...ux.intel.com, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org,
Xiaomeng Tong <xiam0nd.tong@...il.com>
Subject: [PATCH 4/5] gma500: fix a missing break in cdv_intel_dp_set_m_n
Instead of exiting the loop as expected when an entry is found, the
list_for_each_entry() continues until the traversal is complete. It
could lead to a invalid reference to 'lane_count/bpp' after the loop.
The invalid reference to 'lane_count/bpp' is here:
cdv_intel_dp_compute_m_n(bpp, lane_count,
To fix this, when found the entry, add a break after the switch statement.
Fixes: 8695b61294356 ("gma500: Add the support of display port on CDV")
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@...il.com>
---
drivers/gpu/drm/gma500/cdv_intel_dp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
index ba6ad1466374..e6473b8da296 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
@@ -1016,6 +1016,8 @@ cdv_intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
bpp = dev_priv->edp.bpp;
break;
}
+
+ break;
}
/*
--
2.17.1
Powered by blists - more mailing lists