* [PATCH 2.6.15-rc3] Fix NULL-reference in DRM
@ 2005-11-30 14:32 Takashi Iwai
0 siblings, 0 replies; only message in thread
From: Takashi Iwai @ 2005-11-30 14:32 UTC (permalink / raw)
To: linux-kernel; +Cc: Linus Torvalds
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@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-11-30 14:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-30 14:32 [PATCH 2.6.15-rc3] Fix NULL-reference in DRM Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®