From owner-svn-src-all@FreeBSD.ORG Tue Jul 20 18:43:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A67D31065676; Tue, 20 Jul 2010 18:43:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 942EA8FC18; Tue, 20 Jul 2010 18:43:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KIhGxX077125; Tue, 20 Jul 2010 18:43:16 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KIhGSK077124; Tue, 20 Jul 2010 18:43:16 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007201843.o6KIhGSK077124@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 20 Jul 2010 18:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210304 - stable/8/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 18:43:16 -0000 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(®s); 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);