drm/xe/vm: Fix an error path
authorThomas Hellström <thomas.hellstrom@linux.intel.com>
Fri, 22 Dec 2023 17:59:04 +0000 (18:59 +0100)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Tue, 9 Jan 2024 16:22:21 +0000 (17:22 +0100)
commit9d0c1c5618be02c5acda7e6bbb728007b0632984
treef0b8a1d8a243f04a0184494e2be3c8e5ee982206
parent5030e16140b655ba00217d47680e697480ac3587
drm/xe/vm: Fix an error path

If using the VM_BIND_OP_UNMAP_ALL without any bound vmas for the
vm, we will end up dereferencing an uninitialized variable and leak a
bo lock. Fix this.

v2:
- Updated commit message (Lucas De Marchi)

Reported-by: Dafna Hirschfeld <dhirschfeld@habana.ai>
Closes: https://lore.kernel.org/intel-xe/jrwua7ckbiozfcaodx4gg2h4taiuxs53j5zlpf3qzvyhyiyl2d@pbs3plurokrj/
Suggested-by: Dafna Hirschfeld <dhirschfeld@habana.ai>
Fixes: b06d47be7c83 ("drm/xe: Port Xe to GPUVA")
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231222175904.16732-1-thomas.hellstrom@linux.intel.com
drivers/gpu/drm/xe/xe_vm.c