]> Gentwo Git Trees - linux/.git/commit
drm/gem: Correct error condition in drm_gem_objects_lookup
authorSteven Price <steven.price@arm.com>
Mon, 24 Nov 2025 11:20:38 +0000 (11:20 +0000)
committerSteven Price <steven.price@arm.com>
Wed, 26 Nov 2025 11:18:18 +0000 (11:18 +0000)
commit922682d48d628c6c5540da2eb5481f7f7694ce48
tree6621fe0b9b3228764b36aaf758075111945dde34
parente20c6260474c45f66c636a50d5b8801759ffe09e
drm/gem: Correct error condition in drm_gem_objects_lookup

When vmemdup_array_user() fails, 'handles' is set to a negative error
code and no memory is allocated. So the call to kvfree() should not
happen. Instead just return early with the error code.

Fixes: cb77b79abf5f ("drm/gem: Use vmemdup_array_user in drm_gem_objects_lookup")
Signed-off-by: Steven Price <steven.price@arm.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Link: https://patch.msgid.link/20251124112039.117748-1-steven.price@arm.com
drivers/gpu/drm/drm_gem.c