From: Dave Airlie Date: Mon, 2 Jan 2006 08:23:44 +0000 (+1100) Subject: drm: fix issue with contexts running out of RAM X-Git-Tag: firefly_0821_release~38914^2~14 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b5e9fc13dd0f25a2f422000c185f491bfd4f7335;p=firefly-linux-kernel-4.4.55.git drm: fix issue with contexts running out of RAM Signed-off-by: Dave Airlie --- diff --git a/drivers/char/drm/drm_context.c b/drivers/char/drm/drm_context.c index bdd168d88f49..7a7bcef2aa84 100644 --- a/drivers/char/drm/drm_context.c +++ b/drivers/char/drm/drm_context.c @@ -432,6 +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)) { + DRM_DEBUG("Running out of ctxs or memory.\n"); + return -ENOMEM; + } dev->driver->context_ctor(dev, ctx.handle); }