From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 02:23:49 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B6E21065676; Thu, 11 Dec 2008 02:23:49 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 780188FC1C; Thu, 11 Dec 2008 02:23:49 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB2NnVj049844; Thu, 11 Dec 2008 02:23:49 GMT (envelope-from ps@svn.freebsd.org) Received: (from ps@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB2NnjW049843; Thu, 11 Dec 2008 02:23:49 GMT (envelope-from ps@svn.freebsd.org) Message-Id: <200812110223.mBB2NnjW049843@svn.freebsd.org> From: Paul Saab Date: Thu, 11 Dec 2008 02:23:49 +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: r185902 - head/sys/boot/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 02:23:49 -0000 Author: ps Date: Thu Dec 11 02:23:49 2008 New Revision: 185902 URL: http://svn.freebsd.org/changeset/base/185902 Log: Avoid a double free in devopen by not freeing the device structure in zfs_dev_open. This stops a panic in the loader when trying to read from a zfs device and no zfs devices exist. Modified: head/sys/boot/zfs/zfs.c Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Thu Dec 11 01:41:38 2008 (r185901) +++ head/sys/boot/zfs/zfs.c Thu Dec 11 02:23:49 2008 (r185902) @@ -474,7 +474,6 @@ zfs_dev_open(struct open_file *f, ...) * the pool. */ unit = dev->d_unit; - free(dev); i = 0; STAILQ_FOREACH(spa, &zfs_pools, spa_link) {