Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Mar 2018 15:36:25 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r331491 - in head/sys/geom: journal label
Message-ID:  <201803241536.w2OFaPkw098073@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Sat Mar 24 15:36:25 2018
New Revision: 331491
URL: https://svnweb.freebsd.org/changeset/base/331491

Log:
  When freeing a superblock returned by ffs_sbget, be sure to also
  free the superblock summary information.
  
  Reported by: Peter Holm (pho@)
  Tested by: Peter Holm (pho@)

Modified:
  head/sys/geom/journal/g_journal_ufs.c
  head/sys/geom/label/g_label_ufs.c

Modified: head/sys/geom/journal/g_journal_ufs.c
==============================================================================
--- head/sys/geom/journal/g_journal_ufs.c	Sat Mar 24 13:51:27 2018	(r331490)
+++ head/sys/geom/journal/g_journal_ufs.c	Sat Mar 24 15:36:25 2018	(r331491)
@@ -83,6 +83,7 @@ g_journal_ufs_dirty(struct g_consumer *cp)
 	fs->fs_clean = 0;
 	fs->fs_flags |= FS_NEEDSFSCK | FS_UNCLEAN;
 	error = ffs_sbput(cp, fs, fs->fs_sblockloc, g_use_g_write_data);
+	g_free(fs->fs_csp);
 	g_free(fs);
 	if (error != 0) {
 		GJ_DEBUG(0, "Cannot mark file system %s as dirty "

Modified: head/sys/geom/label/g_label_ufs.c
==============================================================================
--- head/sys/geom/label/g_label_ufs.c	Sat Mar 24 13:51:27 2018	(r331490)
+++ head/sys/geom/label/g_label_ufs.c	Sat Mar 24 15:36:25 2018	(r331491)
@@ -103,8 +103,7 @@ g_label_ufs_taste_common(struct g_consumer *cp, char *
 		|| G_LABEL_UFS_CMP(pp, fs, fs_providersize))) {
 		/* Valid UFS2. */
 	} else {
-		g_free(fs);
-		return;
+		goto out;
 	}
 	G_LABEL_DEBUG(1, "%s file system detected on %s.",
 	    fs->fs_magic == FS_UFS1_MAGIC ? "UFS1" : "UFS2", pp->name);
@@ -120,6 +119,8 @@ g_label_ufs_taste_common(struct g_consumer *cp, char *
 			    fs->fs_id[1]);
 		break;
 	}
+out:
+	g_free(fs->fs_csp);
 	g_free(fs);
 }
 



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