From owner-svn-src-all@FreeBSD.ORG Thu Jun 11 15:16:07 2009 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 B9547106566C; Thu, 11 Jun 2009 15:16:07 +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 A6B958FC0C; Thu, 11 Jun 2009 15:16:07 +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 n5BFG7NS051232; Thu, 11 Jun 2009 15:16:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BFG7CT051231; Thu, 11 Jun 2009 15:16:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906111516.n5BFG7CT051231@svn.freebsd.org> From: John Baldwin Date: Thu, 11 Jun 2009 15:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194007 - in stable/6/sys: . boot/i386/libi386 contrib/pf dev/cxgb 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: Thu, 11 Jun 2009 15:16:08 -0000 Author: jhb Date: Thu Jun 11 15:16:07 2009 New Revision: 194007 URL: http://svn.freebsd.org/changeset/base/194007 Log: MFC: Don't attempt to free the GPT partition list for a disk with an empty GPT. Modified: stable/6/sys/ (props changed) stable/6/sys/boot/i386/libi386/biosdisk.c stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- stable/6/sys/boot/i386/libi386/biosdisk.c Thu Jun 11 15:15:40 2009 (r194006) +++ stable/6/sys/boot/i386/libi386/biosdisk.c Thu Jun 11 15:16:07 2009 (r194007) @@ -995,7 +995,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); return (error); } @@ -1046,7 +1047,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);