]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/guc: fix NULL vs IS_ERR() checking
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 16 Nov 2021 11:49:16 +0000 (14:49 +0300)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Wed, 17 Nov 2021 13:46:55 +0000 (08:46 -0500)
The intel_engine_create_virtual() function does not return NULL.  It
returns error pointers.

Fixes: 156441007d97 ("drm/i915/guc: Connect UAPI to GuC multi-lrc interface")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211116114916.GB11936@kili
(cherry picked from commit fc12b70d12d07598cde27cc17dbfafc2a2a33ff8)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c

index 38b47e73e35dbd013aacd8cc9f1cfe659e14203a..c48557dfa04c4a73ef2dbdb51134722fe0b40142 100644 (file)
@@ -3080,8 +3080,8 @@ guc_create_parallel(struct intel_engine_cs **engines,
 
                ce = intel_engine_create_virtual(siblings, num_siblings,
                                                 FORCE_VIRTUAL);
-               if (!ce) {
-                       err = ERR_PTR(-ENOMEM);
+               if (IS_ERR(ce)) {
+                       err = ERR_CAST(ce);
                        goto unwind;
                }