summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2005-12-04 01:24:23 +0000
committerDave Airlie <airlied@linux.ie>2005-12-04 01:24:23 +0000
commitbe16e93537d746365a43479de3a997af7969bb84 (patch)
tree581aafa2a324f489067d09816c63ee8612afb8e2 /linux-core
parentf5a9f27bf6c831f244bc27f82ed49f35d832178e (diff)
Fix from SuSE for issue with context creation failure
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_context.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/linux-core/drm_context.c b/linux-core/drm_context.c
index 5947c8e6..b8702e6d 100644
--- a/linux-core/drm_context.c
+++ b/linux-core/drm_context.c
@@ -431,7 +431,10 @@ int drm_addctx(struct inode *inode, struct file *filp,
if (ctx.handle != DRM_KERNEL_CONTEXT) {
if (dev->driver->context_ctor)
- 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;
+ }
}
ctx_entry = drm_alloc(sizeof(*ctx_entry), DRM_MEM_CTXLIST);