Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 May 2010 01:44:30 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r208477 - stable/8/sys/dev/fb
Message-ID:  <201005240144.o4O1iU4q051458@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Mon May 24 01:44:30 2010
New Revision: 208477
URL: http://svn.freebsd.org/changeset/base/208477

Log:
  MFC:	r208276
  
  Remove unnecessary pointer increment. A wrong pointer may be passed to
  free(9) and it can cause kernel panic when there are multiple graphics
  controllers in the system.

Modified:
  stable/8/sys/dev/fb/vesa.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/fb/vesa.c
==============================================================================
--- stable/8/sys/dev/fb/vesa.c	Sun May 23 22:10:20 2010	(r208476)
+++ stable/8/sys/dev/fb/vesa.c	Mon May 24 01:44:30 2010	(r208477)
@@ -240,10 +240,10 @@ vesa_bios_post(void)
 	/* Find the matching PCI video controller. */
 	dc = devclass_find("vgapci");
 	if (dc != NULL && devclass_get_devices(dc, &devs, &count) == 0) {
-		for (dev = NULL, i = 0; dev == NULL && i < count; devs++, i++)
-			if (device_get_flags(*devs) != 0 &&
-			    x86bios_match_device(0xc0000, *devs)) {
-				dev = *devs;
+		for (i = 0; i < count; i++)
+			if (device_get_flags(devs[i]) != 0 &&
+			    x86bios_match_device(0xc0000, devs[i])) {
+				dev = devs[i];
 				is_pci = 1;
 				break;
 			}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005240144.o4O1iU4q051458>