In the Linux kernel, the following vulnerability has been resolved:
drm/i915/bios: range check LFP Data Block panel_type2
While the panel_type from LFP Data Block is range checked, panel_type2 is not. Add a few helpers for range checking, and use them to not only check panel_type2, but also improve clarity and correctness in the panel type selection.
Discovered using AI-assisted static analysis confirmed by Intel Product Security.
v2:
(cherry picked from commit c9ebe5d2f25729d6cfbbb1235d640bf67f9275df)