]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/udl: Return error if vendor descriptor is too short
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 10 Apr 2025 10:59:03 +0000 (12:59 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 14 Apr 2025 08:19:19 +0000 (10:19 +0200)
commit1fad33f04ed1fd14049cda6a35faa4abc0886201
tree17f17b8f7ebe0d8e016de6ada06c8480059d48be
parent895452ae48c1e179df509b6184227a5ea40b4f38
drm/udl: Return error if vendor descriptor is too short

There need to be least 5 bytes in the vendor descriptor. Return
an error otherwise. Also change the branching to early-out on
the error. Adjust indention of the rest of the parser function.

The original length test expected more than 5 bytes in the vendor
descriptor. As a descriptor with no key-value pairs has exactly 5
bytes and is still valid, change the test to accept this case as
well.

v2
- clarify changes to length test in commit description (Patrik)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://lore.kernel.org/r/20250410105948.25463-7-tzimmermann@suse.de
drivers/gpu/drm/udl/udl_main.c