[PATCH] drm/i915: Fix error code in __create_hw_context()

Dan Carpenter dan.carpenter at oracle.com
Wed Jul 12 07:27:10 UTC 2017


We accidentally forget to set the error code here, which means that we
return NULL.  The callers aren't expecting that and Oops.

Fixes: 4ff4b44cbb70 ("drm/i915: Store a direct lookup from object handle to vma")
Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 39ed58a21fc1..25a73365a5be 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -275,8 +275,10 @@ __create_hw_context(struct drm_i915_private *dev_priv,
 	ctx->vma_lut.ht = kcalloc(ctx->vma_lut.ht_size,
 				  sizeof(*ctx->vma_lut.ht),
 				  GFP_KERNEL);
-	if (!ctx->vma_lut.ht)
+	if (!ctx->vma_lut.ht) {
+		ret = -ENOMEM;
 		goto err_out;
+	}
 
 	INIT_WORK(&ctx->vma_lut.resize, resize_vma_ht);
 


More information about the dri-devel mailing list