drm/i915/uc: Reject duplicate entries in firmware table
authorJohn Harrison <John.C.Harrison@Intel.com>
Tue, 2 May 2023 23:40:06 +0000 (16:40 -0700)
committerJohn Harrison <John.C.Harrison@Intel.com>
Fri, 5 May 2023 22:33:57 +0000 (15:33 -0700)
commitbef550c952a71df6a6e86b11bdac5b10dac29163
tree8c5b9c4c637de5afb38bcd50aa01870e8de5f763
parentedba77891b58a1f0626daf8598717b8efb307bc8
drm/i915/uc: Reject duplicate entries in firmware table

It was noticed that duplicate entries in the firmware table could cause
an infinite loop in the firmware loading code if that entry failed to
load. Duplicate entries are a bug anyway and so should never happen.
Ensure they don't by tweaking the table validation code to reject
duplicates.

For full m/m/p files, that can be done by simply tweaking the patch
level check to reject matching values. For reduced version entries,
the filename itself must be compared.

v2: Improve comment (review by Daniele)

Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230502234007.1762014-6-John.C.Harrison@Intel.com
drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c