]> err.no Git - linux-2.6/commitdiff
drm: proper fix for drm_context
authorDave Airlie <airlied@starflyer.(none)>
Mon, 2 Jan 2006 08:25:35 +0000 (19:25 +1100)
committerDave Airlie <airlied@linux.ie>
Mon, 2 Jan 2006 08:25:35 +0000 (19:25 +1100)
Bad patch in last version

Signed-off-by: Dave Airlie <airlied@linux.ie>
drivers/char/drm/drm_context.c

index 7a7bcef2aa84e4ac9d2ca9cfb3f627be59305cb8..f8425452694957d6c74a2955eac8e3abc8310f03 100644 (file)
@@ -432,11 +432,10 @@ int drm_addctx(struct inode *inode, struct file *filp,
 
        if (ctx.handle != DRM_KERNEL_CONTEXT) {
                if (dev->driver->context_ctor)
-                       if (dev->driver->context_ctor(dev, ctx.handle)) {
+                       if (!dev->driver->context_ctor(dev, ctx.handle)) {
                                DRM_DEBUG("Running out of ctxs or memory.\n");
                                return -ENOMEM;
                        }
-                       dev->driver->context_ctor(dev, ctx.handle);
        }
 
        ctx_entry = drm_alloc(sizeof(*ctx_entry), DRM_MEM_CTXLIST);