diff options
author | ae <ae@FreeBSD.org> | 2010-09-25 18:27:29 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2010-09-25 18:27:29 +0000 |
commit | 0afdf593c022f2bd75eb54c4294be01ad4861f38 (patch) | |
tree | 47df08cdc48d06fce38f212001355085a114a3be /sys/geom/part | |
parent | c9b8dcdf95030c63993c19a2be8e2505eb644375 (diff) | |
download | FreeBSD-src-0afdf593c022f2bd75eb54c4294be01ad4861f38.zip FreeBSD-src-0afdf593c022f2bd75eb54c4294be01ad4861f38.tar.gz |
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)
Diffstat (limited to 'sys/geom/part')
-rw-r--r-- | sys/geom/part/g_part.c | 1 | ||||
-rw-r--r-- | sys/geom/part/g_part_mbr.c | 1 | ||||
-rw-r--r-- | sys/geom/part/g_part_pc98.c | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c index cd1979b..9e7c9c0 100644 --- a/sys/geom/part/g_part.c +++ b/sys/geom/part/g_part.c @@ -1273,6 +1273,7 @@ g_part_wither(struct g_geom *gp, int error) 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); diff --git a/sys/geom/part/g_part_mbr.c b/sys/geom/part/g_part_mbr.c index 6cc6245..c006c59 100644 --- a/sys/geom/part/g_part_mbr.c +++ b/sys/geom/part/g_part_mbr.c @@ -465,6 +465,7 @@ g_part_mbr_read(struct g_part_table *basetable, struct g_consumer *cp) basetable->gpt_first = basetable->gpt_sectors; basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1; + g_free(buf); return (0); } diff --git a/sys/geom/part/g_part_pc98.c b/sys/geom/part/g_part_pc98.c index ab83662..a4235d6 100644 --- a/sys/geom/part/g_part_pc98.c +++ b/sys/geom/part/g_part_pc98.c @@ -458,6 +458,7 @@ g_part_pc98_read(struct g_part_table *basetable, struct g_consumer *cp) basetable->gpt_first = cyl; basetable->gpt_last = msize - (msize % cyl) - 1; + g_free(buf); return (0); } |