Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Nov 2008 13:22:24 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185171 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <200811221322.mAMDMOw4018803@svn.freebsd.org>

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



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