Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / drivers / gpu / drm / drm_context.c
index 7d1e53c..6d440fb 100644 (file)
@@ -333,15 +333,7 @@ int drm_addctx(struct drm_device *dev, void *data,
                return -ENOMEM;
        }
 
-       if (ctx->handle != DRM_KERNEL_CONTEXT) {
-               if (dev->driver->context_ctor)
-                       if (!dev->driver->context_ctor(dev, ctx->handle)) {
-                               DRM_DEBUG("Running out of ctxs or memory.\n");
-                               return -ENOMEM;
-                       }
-       }
-
-       ctx_entry = drm_alloc(sizeof(*ctx_entry), DRM_MEM_CTXLIST);
+       ctx_entry = kmalloc(sizeof(*ctx_entry), GFP_KERNEL);
        if (!ctx_entry) {
                DRM_DEBUG("out of memory\n");
                return -ENOMEM;
@@ -456,7 +448,7 @@ int drm_rmctx(struct drm_device *dev, void *data,
                list_for_each_entry_safe(pos, n, &dev->ctxlist, head) {
                        if (pos->handle == ctx->handle) {
                                list_del(&pos->head);
-                               drm_free(pos, sizeof(*pos), DRM_MEM_CTXLIST);
+                               kfree(pos);
                                --dev->ctx_count;
                        }
                }