From owner-svn-src-stable-7@FreeBSD.ORG Thu Jun 11 15:15:41 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5937D1065679; Thu, 11 Jun 2009 15:15:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A5F48FC20; Thu, 11 Jun 2009 15:15:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BFFerT051179; Thu, 11 Jun 2009 15:15:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BFFeEB051178; Thu, 11 Jun 2009 15:15:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906111515.n5BFFeEB051178@svn.freebsd.org> From: John Baldwin Date: Thu, 11 Jun 2009 15:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194006 - in stable/7/sys: . boot/i386/libi386 contrib/pf dev/ath/ath_hal X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 15:15:44 -0000 Author: jhb Date: Thu Jun 11 15:15:40 2009 New Revision: 194006 URL: http://svn.freebsd.org/changeset/base/194006 Log: MFC: Don't attempt to free the GPT partition list for a disk with an empty GPT. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/i386/libi386/biosdisk.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) Modified: stable/7/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- stable/7/sys/boot/i386/libi386/biosdisk.c Thu Jun 11 15:07:02 2009 (r194005) +++ stable/7/sys/boot/i386/libi386/biosdisk.c Thu Jun 11 15:15:40 2009 (r194006) @@ -998,7 +998,8 @@ bd_open_gpt(struct open_disk *od, struct out: if (error) { - free(od->od_partitions); + if (od->od_nparts > 0) + free(od->od_partitions); od->od_flags &= ~BD_GPTOK; } return (error); @@ -1052,7 +1053,7 @@ bd_closedisk(struct open_disk *od) delay(3000000); #endif #ifdef LOADER_GPT_SUPPORT - if (od->od_flags & BD_GPTOK) + if (od->od_flags & BD_GPTOK && od->od_nparts > 0) free(od->od_partitions); #endif free(od);