On Thu, Jan 14, 2016 at 11:46:42AM +0530, ankitprasad.r.sharma@xxxxxxxxx wrote: > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c > index 6a429c0..b7dcd21 100644 > --- a/drivers/gpu/drm/i915/i915_gem.c > +++ b/drivers/gpu/drm/i915/i915_gem.c > @@ -396,19 +396,18 @@ i915_gem_alloc_object_stolen(struct drm_device *dev, size_t size) > > mutex_lock(&dev->struct_mutex); > obj = i915_gem_object_create_stolen(dev, size); > - if (!obj) { > - mutex_unlock(&dev->struct_mutex); > - return NULL; > - } > + if (IS_ERR(obj)) > + goto out; > > /* Always clear fresh buffers before handing to userspace */ > ret = i915_gem_object_clear(obj); > if (ret) { > drm_gem_object_unreference(&obj->base); > mutex_unlock(&dev->struct_mutex); > - return NULL; > + return ERR_PTR(ret); ret = i915_gem_object_clear(obj); if (ret) { drm_gem_object_unreference(&obj->base); obj = ERR_PTR(ret); goto out; } > } > > +out: > mutex_unlock(&dev->struct_mutex); > return obj; > } -- Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx