Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe: Fix a NULL vs IS_ERR() in xe_vm_add_compute_exec_queue()

The xe_preempt_fence_create() function returns error pointers. It
never returns NULL. Update the error checking to match.

Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://lore.kernel.org/r/aJTMBdX97cof_009@stanley.mountain
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(cherry picked from commit 75cc23ffe5b422bc3cbd5cf0956b8b86e4b0e162)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

authored by

Dan Carpenter and committed by
Rodrigo Vivi
cbc7f3b4 7926ba21

+2 -2
+2 -2
drivers/gpu/drm/xe/xe_vm.c
··· 240 240 241 241 pfence = xe_preempt_fence_create(q, q->lr.context, 242 242 ++q->lr.seqno); 243 - if (!pfence) { 244 - err = -ENOMEM; 243 + if (IS_ERR(pfence)) { 244 + err = PTR_ERR(pfence); 245 245 goto out_fini; 246 246 } 247 247