* [patch] drm/i915: checking IS_ERR() instead of NULL
@ 2015-04-30 14:30 Dan Carpenter
2015-04-30 14:43 ` Chris Wilson
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2015-04-30 14:30 UTC (permalink / raw)
To: Daniel Vetter, Chris Wilson
Cc: David Airlie, intel-gfx, kernel-janitors, dri-devel
We switched from calling i915_gem_alloc_context_obj() to calling
i915_gem_alloc_object() so the error handling needs to be updated to
check for NULL instead of IS_ERR().
Fixes: 149c86e74fe4 ('drm/i915: Allocate context objects from stolen')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 732fd63..0fa9209 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1895,10 +1895,9 @@ int intel_lr_context_deferred_create(struct intel_context *ctx,
context_size = round_up(get_lr_context_size(ring), 4096);
ctx_obj = i915_gem_alloc_object(dev, context_size);
- if (IS_ERR(ctx_obj)) {
- ret = PTR_ERR(ctx_obj);
- DRM_DEBUG_DRIVER("Alloc LRC backing obj failed: %d\n", ret);
- return ret;
+ if (!ctx_obj) {
+ DRM_DEBUG_DRIVER("Alloc LRC backing obj failed.\n");
+ return -ENOMEM;
}
if (is_global_default_ctx) {
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [patch] drm/i915: checking IS_ERR() instead of NULL
2015-04-30 14:30 [patch] drm/i915: checking IS_ERR() instead of NULL Dan Carpenter
@ 2015-04-30 14:43 ` Chris Wilson
2015-04-30 14:47 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2015-04-30 14:43 UTC (permalink / raw)
To: Dan Carpenter
Cc: David Airlie, intel-gfx, kernel-janitors, dri-devel,
Daniel Vetter
On Thu, Apr 30, 2015 at 05:30:50PM +0300, Dan Carpenter wrote:
> We switched from calling i915_gem_alloc_context_obj() to calling
> i915_gem_alloc_object() so the error handling needs to be updated to
> check for NULL instead of IS_ERR().
I had a patch to change i915_gem_alloc_object() to report the correct
error rather than NULL - which can come in surprisingly handy at
times...
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] drm/i915: checking IS_ERR() instead of NULL
2015-04-30 14:43 ` Chris Wilson
@ 2015-04-30 14:47 ` Dan Carpenter
2015-05-05 7:30 ` Daniel Vetter
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2015-04-30 14:47 UTC (permalink / raw)
To: Chris Wilson, Daniel Vetter, Jani Nikula, David Airlie, intel-gfx,
dri-devel, kernel-janitors
On Thu, Apr 30, 2015 at 03:43:02PM +0100, Chris Wilson wrote:
> On Thu, Apr 30, 2015 at 05:30:50PM +0300, Dan Carpenter wrote:
> > We switched from calling i915_gem_alloc_context_obj() to calling
> > i915_gem_alloc_object() so the error handling needs to be updated to
> > check for NULL instead of IS_ERR().
>
> I had a patch to change i915_gem_alloc_object() to report the correct
> error rather than NULL - which can come in surprisingly handy at
> times...
That also works, of course. Send it. :)
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] drm/i915: checking IS_ERR() instead of NULL
2015-04-30 14:47 ` Dan Carpenter
@ 2015-05-05 7:30 ` Daniel Vetter
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2015-05-05 7:30 UTC (permalink / raw)
To: Dan Carpenter; +Cc: intel-gfx, kernel-janitors, dri-devel, Daniel Vetter
On Thu, Apr 30, 2015 at 05:47:13PM +0300, Dan Carpenter wrote:
> On Thu, Apr 30, 2015 at 03:43:02PM +0100, Chris Wilson wrote:
> > On Thu, Apr 30, 2015 at 05:30:50PM +0300, Dan Carpenter wrote:
> > > We switched from calling i915_gem_alloc_context_obj() to calling
> > > i915_gem_alloc_object() so the error handling needs to be updated to
> > > check for NULL instead of IS_ERR().
> >
> > I had a patch to change i915_gem_alloc_object() to report the correct
> > error rather than NULL - which can come in surprisingly handy at
> > times...
>
> That also works, of course. Send it. :)
Doesn't seem to have shown up yet, I applied your patch meanwhile.
Thanks, Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-05 7:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-30 14:30 [patch] drm/i915: checking IS_ERR() instead of NULL Dan Carpenter
2015-04-30 14:43 ` Chris Wilson
2015-04-30 14:47 ` Dan Carpenter
2015-05-05 7:30 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).