Skip to contentSkip to conversation

drm/i915/gvt: Fix the kernel null pointer error

PATCH New fred gao 1 participant 1 message Aug 16, 2017

Subsystems (4)
lore
Share & tools
lore

fred gao

author
#0 lore raw

PATCH 1/1 drm/i915/gvt: Fix the kernel null pointer error

once error happens in shadow_indirect_ctx function, the variable wa_ctx->indirect_ctx.obj is not initialized but accessed, so the kernel null point panic occurs.

Fixes 894cf7d15634 ("drm/i915/gvt: i915_gem_object_create() returns an error pointer")
---
 drivers/gpu/drm/i915/gvt/cmd_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/gvt/cmd_parser.c +1 -1
index 23a9bbb..2c0ccbb 100644
@@ -2725,7 +2725,7 @@ static int shadow_indirect_ctx(struct intel_shadow_wa_ctx *wa_ctx)
 unmap_src:
 	i915_gem_object_unpin_map(obj);
 put_obj:
-	i915_gem_object_put(wa_ctx->indirect_ctx.obj);
+	i915_gem_object_put(obj);
 	return ret;
 }
 
Signature · 1 line
2.7.4