linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Abraham vd Merwe <abraham@2d3d.co.za>
To: DRI Patches <dri-patches@lists.sourceforge.net>
Cc: Linux Kernel Development <linux-kernel@vger.kernel.org>
Subject: DRM bugfix
Date: Fri, 5 Oct 2001 13:39:22 +0200	[thread overview]
Message-ID: <20011005133922.A20358@crystal.2d3d.co.za> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1009 bytes --]

Hi!

I found a small bug in drm_proc.h. DRM(_vm_info) tries to access
dev->maplist, but dev->maplist is only intitialized when the device is
opened, so if you do a cat /proc/dri/0/vm just after you load any DRM module
(just before loading X), you'll get an oops and mess up the whole proc
system in the process...

I've attached a fix for it. The patch is against the 2.4.10 kernel, but I
think drm_proc.h in the 2.4.10 kernel is the same as in the DRI CVS
repository.

-- 

Regards
 Abraham

One can never consent to creep when one feels an impulse to soar.
		-- Helen Keller

__________________________________________________________
 Abraham vd Merwe - 2d3D, Inc.

 Device Driver Development, Outsourcing, Embedded Systems

  Cell: +27 82 565 4451         Snailmail:
   Tel: +27 21 761 7549            Block C, Antree Park
   Fax: +27 21 761 7648            Doncaster Road
 Email: abraham@2d3d.co.za         Kenilworth, 7700
  Http: http://www.2d3d.com        South Africa


[-- Attachment #1.2: maplist-fix.diff --]
[-- Type: text/plain, Size: 596 bytes --]

diff -Nrup linux-2.4.10.orig/drivers/char/drm/drm_proc.h linux-2.4.10/drivers/char/drm/drm_proc.h
--- linux-2.4.10.orig/drivers/char/drm/drm_proc.h	Wed Aug 15 23:21:47 2001
+++ linux-2.4.10/drivers/char/drm/drm_proc.h	Fri Oct  5 13:33:54 2001
@@ -186,7 +186,7 @@ static int DRM(_vm_info)(char *buf, char
 	DRM_PROC_PRINT("slot	 offset	      size type flags	 "
 		       "address mtrr\n\n");
 	i = 0;
-	list_for_each(list, &dev->maplist->head) {
+	if (dev->maplist != NULL) list_for_each(list, &dev->maplist->head) {
 		r_list = (drm_map_list_t *)list;
 		map = r_list->map;
 		if(!map) continue;

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

                 reply	other threads:[~2001-10-05 11:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011005133922.A20358@crystal.2d3d.co.za \
    --to=abraham@2d3d.co.za \
    --cc=dri-patches@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).