From owner-svn-src-stable@FreeBSD.ORG Tue Oct 23 15:36:24 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CDC7443; Tue, 23 Oct 2012 15:36:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44AE48FC0A; Tue, 23 Oct 2012 15:36:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9NFaOIc099669; Tue, 23 Oct 2012 15:36:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NFaOqO099667; Tue, 23 Oct 2012 15:36:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210231536.q9NFaOqO099667@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Oct 2012 15:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241948 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:36:24 -0000 Author: mav Date: Tue Oct 23 15:36:23 2012 New Revision: 241948 URL: http://svn.freebsd.org/changeset/base/241948 Log: MFC r241510: Don't exclude XPT SIM from locking in xpt_create_path_unlocked(). We don't want xpt periph, device, target or bus disappeared because of incorrect reference counting. Modified: stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:34:51 2012 (r241947) +++ stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:36:23 2012 (r241948) @@ -3433,19 +3433,14 @@ xpt_create_path_unlocked(struct cam_path struct cam_path *path; struct cam_eb *bus = NULL; cam_status status; - int need_unlock = 0; path = (struct cam_path *)malloc(sizeof(*path), M_CAMPATH, M_WAITOK); - if (path_id != CAM_BUS_WILDCARD) { - bus = xpt_find_bus(path_id); - if (bus != NULL) { - need_unlock = 1; - CAM_SIM_LOCK(bus->sim); - } - } + bus = xpt_find_bus(path_id); + if (bus != NULL) + CAM_SIM_LOCK(bus->sim); status = xpt_compile_path(path, periph, path_id, target_id, lun_id); - if (need_unlock) { + if (bus != NULL) { CAM_SIM_UNLOCK(bus->sim); xpt_release_bus(bus); }