提交 be636387 编写于 作者: D Dan Carpenter 提交者: Daniel Vetter

drm/i915: dereferencing an error pointer

We need to check that "ctx" is a valid pointer before dereferencing it.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 b259b312
......@@ -497,11 +497,13 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
ctx = create_hw_context(dev, file_priv);
mutex_unlock(&dev->struct_mutex);
if (IS_ERR(ctx))
return PTR_ERR(ctx);
args->ctx_id = ctx->id;
DRM_DEBUG_DRIVER("HW context %d created\n", args->ctx_id);
return PTR_RET(ctx);
return 0;
}
int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册