DragonFlyBSD Kernel Audit
DF-1567 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/drm/drm_dp_helper.c b/sys/dev/drm/drm_dp_helper.c
--- a/sys/dev/drm/drm_dp_helper.c
+++ b/sys/dev/drm/drm_dp_helper.c
@@ -51,6 +51,8 @@
 static u8 dp_get_lane_status(const u8 link_status[DP_LINK_STATUS_SIZE],
 			     int lane)
 {
+	if (lane >= DP_MAX_LANE_COUNT)
+		return 0;
 	int i = DP_LANE0_1_STATUS + (lane >> 1);
 	int s = (lane & 1) * 4;
 	u8 l = dp_link_status(link_status, i);