From: Dave Airlie Date: Sun, 4 Dec 2005 01:24:23 +0000 (+0000) Subject: Fix from SuSE for issue with context creation failure X-Git-Tag: submit/1.0/20121108.012404~1538 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be16e93537d746365a43479de3a997af7969bb84;p=profile%2Fivi%2Flibdrm.git Fix from SuSE for issue with context creation failure --- diff --git a/linux-core/drm_context.c b/linux-core/drm_context.c index 5947c8e..b8702e6 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);