svn commit: r185171 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Pawel Jakub Dawidek pjd at FreeBSD.org
Sat Nov 22 05:22:25 PST 2008


Author: pjd
Date: Sat Nov 22 13:22:24 2008
New Revision: 185171
URL: http://svn.freebsd.org/changeset/base/185171

Log:
  IFp4: Don't free pathname too soon, debugging code is still using it.

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c	Sat Nov 22 13:11:11 2008	(r185170)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c	Sat Nov 22 13:22:24 2008	(r185171)
@@ -88,11 +88,9 @@ spa_config_load(void)
 
 	file = kobj_open_file(pathname);
 
-	kmem_free(pathname, MAXPATHLEN);
-
 	if (file == (struct _buf *)-1) {
 		ZFS_LOG(1, "Cannot open %s.", pathname);
-		return;
+		goto out;
 	}
 
 	if (kobj_get_filesize(file, &fsize) != 0) {
@@ -146,10 +144,11 @@ spa_config_load(void)
 	nvlist_free(nvlist);
 
 out:
+	kmem_free(pathname, MAXPATHLEN);
 	if (buf != NULL)
 		kmem_free(buf, fsize);
-
-	kobj_close_file(file);
+	if (file != (struct _buf *)-1)
+		kobj_close_file(file);
 }
 
 static void


More information about the svn-src-all mailing list