]> git.baikalelectronics.ru Git - kernel.git/commit
drm/edid: fix invalid EDID extension block filtering
authorJani Nikula <jani.nikula@intel.com>
Wed, 30 Mar 2022 17:04:26 +0000 (20:04 +0300)
committerJani Nikula <jani.nikula@intel.com>
Thu, 31 Mar 2022 09:43:29 +0000 (12:43 +0300)
commit7d67515a4fcab1f6fdcfd4b384af37d68b183014
tree7b78ad0e92f9c9b525841f63d386cd3cb47bbb69
parent89e7276a944834c9a2bb1a268f5633fffb1b3ebe
drm/edid: fix invalid EDID extension block filtering

The invalid EDID block filtering uses the number of valid EDID
extensions instead of all EDID extensions for looping the extensions in
the copy. This is fine, by coincidence, if all the invalid blocks are at
the end of the EDID. However, it's completely broken if there are
invalid extensions in the middle; the invalid blocks are included and
valid blocks are excluded.

Fix it by modifying the base block after, not before, the copy.

Fixes: 68b5a7812577 ("drm/edid: Only print the bad edid when aborting")
Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220330170426.349248-1-jani.nikula@intel.com
drivers/gpu/drm/drm_edid.c