[PATCH 2.6.15-rc3] Fix NULL-reference in DRM
From: Takashi Iwai
Date: Wed Nov 30 2005 - 09:40:39 EST
This patch fixes the NULL pointer reference in DRM.
SiS driver tries to allocate a big chunk of memory, but the return
value is never checked.
Reported in Novell bugzilla #132271:
https://bugzilla.novell.com/show_bug.cgi?id=132271
From: Egbert Eich <eich@xxxxxxx>
Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
diff --git a/drivers/char/drm/drm_context.c b/drivers/char/drm/drm_context.c
--- a/drivers/char/drm/drm_context.c
+++ b/drivers/char/drm/drm_context.c
@@ -432,7 +432,10 @@ int drm_addctx(struct inode *inode, stru
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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/