diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-07-17 06:44:49 (GMT) |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-07-25 08:39:58 (GMT) |
commit | be636387f81376ff26963987531c89a63faf8a33 (patch) | |
tree | e73886593a4739238109def962d01ca8f8bae38f /drivers | |
parent | b259b3120607f642daabdaadc99430a306899ffe (diff) | |
download | linux-fsl-qoriq-be636387f81376ff26963987531c89a63faf8a33.tar.xz |
drm/i915: dereferencing an error pointer
We need to check that "ctx" is a valid pointer before dereferencing it.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_context.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index 873119f..da8b01f 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -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, |