summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2022-06-10 01:15:32 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2022-06-10 01:15:32 +0000
commitc5f799d854b756ce615aedff232e7a1f95b70566 (patch)
tree3707b516fff329698c92f6fa97facec061a4321c /sys
parentf0e73740871dd533f8a8644601457e5ea054b004 (diff)
drm/edid: fix invalid EDID extension block filtering
From Jani Nikula 96db9afa4958bbaee77995eb0c84e08cdcce74ae in linux 5.15.y/5.15.46 3aefc722ff52076407203b6af9713de567993adf in mainline linux
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/drm_edid.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/drm_edid.c b/sys/dev/pci/drm/drm_edid.c
index 895587a0f15..8f54eeef655 100644
--- a/sys/dev/pci/drm/drm_edid.c
+++ b/sys/dev/pci/drm/drm_edid.c
@@ -2002,9 +2002,6 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
connector_bad_edid(connector, edid, edid[0x7e] + 1);
- edid[EDID_LENGTH-1] += edid[0x7e] - valid_extensions;
- edid[0x7e] = valid_extensions;
-
new = kmalloc_array(valid_extensions + 1, EDID_LENGTH,
GFP_KERNEL);
if (!new)
@@ -2021,6 +2018,9 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
base += EDID_LENGTH;
}
+ new[EDID_LENGTH - 1] += new[0x7e] - valid_extensions;
+ new[0x7e] = valid_extensions;
+
kfree(edid);
edid = new;
}