From owner-svn-src-head@FreeBSD.ORG Thu May 21 13:22:07 2009 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 AC3391065670; Thu, 21 May 2009 13:22:07 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 998B28FC19; Thu, 21 May 2009 13:22:07 +0000 (UTC) (envelope-from attilio@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 n4LDM7o3067925; Thu, 21 May 2009 13:22:07 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4LDM73t067924; Thu, 21 May 2009 13:22:07 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200905211322.n4LDM73t067924@svn.freebsd.org> From: Attilio Rao Date: Thu, 21 May 2009 13:22:07 +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: r192535 - head/sys/kern 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, 21 May 2009 13:22:08 -0000 Author: attilio Date: Thu May 21 13:22:07 2009 New Revision: 192535 URL: http://svn.freebsd.org/changeset/base/192535 Log: Move the M_WAITOK flag in notify() into an M_NOWAIT one in order to match the behaviour alredy present with the further malloc() call in devctl_notify(). This fixes a bug in the CAM layer where the camisr handler finished to call camperiphfree() (and subsequently destroy_dev() resulting in a new dev notify) while the xpt lock is held. PR: kern/130330 Tested by: Riccardo Torrini Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Thu May 21 12:36:40 2009 (r192534) +++ head/sys/kern/kern_conf.c Thu May 21 13:22:07 2009 (r192535) @@ -491,7 +491,9 @@ notify(struct cdev *dev, const char *ev) if (cold) return; namelen = strlen(dev->si_name); - data = malloc(namelen + sizeof(prefix), M_TEMP, M_WAITOK); + data = malloc(namelen + sizeof(prefix), M_TEMP, M_NOWAIT); + if (data == NULL) + return; memcpy(data, prefix, sizeof(prefix) - 1); memcpy(data + sizeof(prefix) - 1, dev->si_name, namelen + 1); devctl_notify("DEVFS", "CDEV", ev, data);