Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Jul 2010 18:43:16 +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: r210304 - stable/8/sys/dev/fb
Message-ID:  <201007201843.o6KIhGSK077124@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Tue Jul 20 18:43:15 2010
New Revision: 210304
URL: http://svn.freebsd.org/changeset/base/210304

Log:
  MFC:	r209737, r209740
  
  Fix a possible null pointer dereference and plug a possible memory leak.

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)

Modified: stable/8/sys/dev/fb/vesa.c
==============================================================================
--- stable/8/sys/dev/fb/vesa.c	Tue Jul 20 18:28:34 2010	(r210303)
+++ stable/8/sys/dev/fb/vesa.c	Tue Jul 20 18:43:15 2010	(r210304)
@@ -536,6 +536,8 @@ vesa_bios_save_restore(int code, void *p
 		return (1);
 
 	buf = x86bios_alloc(&offs, size);
+	if (buf == NULL)
+		return (1);
 
 	x86bios_init_regs(&regs);
 	regs.R_AX = 0x4f04;
@@ -836,7 +838,7 @@ vesa_bios_init(void)
 		    "version 1.2 or later is required.\n",
 		    ((vers & 0xf000) >> 12) * 10 + ((vers & 0x0f00) >> 8),
 		    ((vers & 0x00f0) >> 4) * 10 + (vers & 0x000f));
-		return (1);
+		goto fail;
 	}
 
 	VESA_STRCPY(vesa_oemstr, buf->v_oemstr);



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