From: Dan Carpenter Date: Tue, 16 Nov 2021 11:49:16 +0000 (+0300) Subject: drm/i915/guc: fix NULL vs IS_ERR() checking X-Git-Tag: v6.6.17~3937^2~16^2~1242 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc12b70d12d07598cde27cc17dbfafc2a2a33ff8;p=platform%2Fkernel%2Flinux-rpi.git drm/i915/guc: fix NULL vs IS_ERR() checking The intel_engine_create_virtual() function does not return NULL. It returns error pointers. Fixes: e5e32171a2cf ("drm/i915/guc: Connect UAPI to GuC multi-lrc interface") Signed-off-by: Dan Carpenter Reviewed-by: Rodrigo Vivi Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211116114916.GB11936@kili --- diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c index d7e49f7..77fbcd87 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -3354,8 +3354,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; }