Date: Thu, 11 Jun 2009 15:15:40 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r194006 - in stable/7/sys: . boot/i386/libi386 contrib/pf dev/ath/ath_hal Message-ID: <200906111515.n5BFFeEB051178@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906111515.n5BFFeEB051178>