Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Oct 2010 22:21:01 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r213376 - stable/8/sys/geom/part
Message-ID:  <201010022221.o92ML1Yv056486@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010022221.o92ML1Yv056486>