From owner-svn-src-all@FreeBSD.ORG Thu Oct 28 04:14:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47FB11065672; Thu, 28 Oct 2010 04:14:29 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3698A8FC17; Thu, 28 Oct 2010 04:14:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9S4ETuJ061203; Thu, 28 Oct 2010 04:14:29 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9S4ETeD061201; Thu, 28 Oct 2010 04:14:29 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201010280414.o9S4ETeD061201@svn.freebsd.org> From: "Justin T. Gibbs" Date: Thu, 28 Oct 2010 04:14:29 +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: r214444 - head/sys/dev/xen/blkback X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2010 04:14:29 -0000 Author: gibbs Date: Thu Oct 28 04:14:28 2010 New Revision: 214444 URL: http://svn.freebsd.org/changeset/base/214444 Log: sys/dev/xen/blkback/blkback.c: In xbb_detach() only perform cleanup of our taskqueue and device statistics structures if they have been initialized. This avoids a panic when xbb_detach() is called on a partially initialized device instance, due to an early failure in attach. Sponsored by: Spectra Logic Corporation Modified: head/sys/dev/xen/blkback/blkback.c Modified: head/sys/dev/xen/blkback/blkback.c ============================================================================== --- head/sys/dev/xen/blkback/blkback.c Thu Oct 28 02:59:25 2010 (r214443) +++ head/sys/dev/xen/blkback/blkback.c Thu Oct 28 04:14:28 2010 (r214444) @@ -2827,8 +2827,11 @@ xbb_detach(device_t dev) DPRINTF("\n"); - taskqueue_free(xbb->io_taskqueue); - devstat_remove_entry(xbb->xbb_stats); + if (xbb->io_taskqueue != NULL) + taskqueue_free(xbb->io_taskqueue); + + if (xbb->xbb_stats != NULL) + devstat_remove_entry(xbb->xbb_stats); xbb_close_backend(xbb); xbb_free_communication_mem(xbb);