Fix from SuSE for issue with context creation failure

main
Dave Airlie 2005-12-04 01:24:23 +00:00
parent f5a9f27bf6
commit be16e93537
1 changed files with 4 additions and 1 deletions

View File

@ -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);