Author: ae Date: Sat Oct 2 22:21:01 2010 New Revision: 213376 URL: http://svn.freebsd.org/changeset/base/213376
Log: MFC r213174: Some schemes can allocate memory for internal purposes but when GEOM does withering this memory doesn't freed. Add G_PART_DESTROY call to g_part_wither. Also add missed g_free() call to G_PART_READ method for MBR and PC98 schemes. Submitted by: jh (previous version) Reviewed by: pjd Approved by: kib (mentor) Modified: stable/8/sys/geom/part/g_part.c stable/8/sys/geom/part/g_part_mbr.c stable/8/sys/geom/part/g_part_pc98.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/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Sat Oct 2 22:18:36 2010 (r213375) +++ stable/8/sys/geom/part/g_part.c Sat Oct 2 22:21:01 2010 (r213376) @@ -1204,6 +1204,7 @@ g_part_wither(struct g_geom *gp, int err table = gp->softc; if (table != NULL) { + G_PART_DESTROY(table, NULL); while ((entry = LIST_FIRST(&table->gpt_entry)) != NULL) { LIST_REMOVE(entry, gpe_entry); g_free(entry); Modified: stable/8/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/8/sys/geom/part/g_part_mbr.c Sat Oct 2 22:18:36 2010 (r213375) +++ stable/8/sys/geom/part/g_part_mbr.c Sat Oct 2 22:21:01 2010 (r213376) @@ -465,6 +465,7 @@ g_part_mbr_read(struct g_part_table *bas basetable->gpt_first = basetable->gpt_sectors; basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1; + g_free(buf); return (0); } Modified: stable/8/sys/geom/part/g_part_pc98.c ============================================================================== --- stable/8/sys/geom/part/g_part_pc98.c Sat Oct 2 22:18:36 2010 (r213375) +++ stable/8/sys/geom/part/g_part_pc98.c Sat Oct 2 22:21:01 2010 (r213376) @@ -458,6 +458,7 @@ g_part_pc98_read(struct g_part_table *ba basetable->gpt_first = cyl; basetable->gpt_last = msize - (msize % cyl) - 1; + g_free(buf); return (0); } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"