From owner-svn-src-all@FreeBSD.ORG Sat Sep 25 18:27:29 2010 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 C6921106564A; Sat, 25 Sep 2010 18:27:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B18828FC12; Sat, 25 Sep 2010 18:27:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8PIRT9W069996; Sat, 25 Sep 2010 18:27:29 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8PIRTPN069992; Sat, 25 Sep 2010 18:27:29 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201009251827.o8PIRTPN069992@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sat, 25 Sep 2010 18:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213174 - head/sys/geom/part 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: Sat, 25 Sep 2010 18:27:29 -0000 Author: ae Date: Sat Sep 25 18:27:29 2010 New Revision: 213174 URL: http://svn.freebsd.org/changeset/base/213174 Log: 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: head/sys/geom/part/g_part.c head/sys/geom/part/g_part_mbr.c head/sys/geom/part/g_part_pc98.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sat Sep 25 17:41:02 2010 (r213173) +++ head/sys/geom/part/g_part.c Sat Sep 25 18:27:29 2010 (r213174) @@ -1273,6 +1273,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: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Sat Sep 25 17:41:02 2010 (r213173) +++ head/sys/geom/part/g_part_mbr.c Sat Sep 25 18:27:29 2010 (r213174) @@ -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: head/sys/geom/part/g_part_pc98.c ============================================================================== --- head/sys/geom/part/g_part_pc98.c Sat Sep 25 17:41:02 2010 (r213173) +++ head/sys/geom/part/g_part_pc98.c Sat Sep 25 18:27:29 2010 (r213174) @@ -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); }