From owner-svn-src-head@freebsd.org Thu Nov 30 14:06:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02D78E5745A; Thu, 30 Nov 2017 14:06:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4A0D652E3; Thu, 30 Nov 2017 14:06:55 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAUE6sB4029223; Thu, 30 Nov 2017 14:06:54 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAUE6sWi029222; Thu, 30 Nov 2017 14:06:54 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201711301406.vAUE6sWi029222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 30 Nov 2017 14:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326395 - head/sys/fs/devfs X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/fs/devfs X-SVN-Commit-Revision: 326395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 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, 30 Nov 2017 14:06:56 -0000 Author: manu Date: Thu Nov 30 14:06:54 2017 New Revision: 326395 URL: https://svnweb.freebsd.org/changeset/base/326395 Log: r326394 is calling malloc with M_WAITOK under a lock, revert for now Reported by: andrew Modified: head/sys/fs/devfs/devfs_dir.c Modified: head/sys/fs/devfs/devfs_dir.c ============================================================================== --- head/sys/fs/devfs/devfs_dir.c Thu Nov 30 12:38:42 2017 (r326394) +++ head/sys/fs/devfs/devfs_dir.c Thu Nov 30 14:06:54 2017 (r326395) @@ -98,18 +98,19 @@ devfs_dir_ref(const char *dir) if (*dir == '\0') return; + dle_new = malloc(sizeof(*dle), M_DEVFS4, M_WAITOK); + dle_new->dir = strdup(dir, M_DEVFS4); + dle_new->refcnt = 1; + mtx_lock(&dirlist_mtx); dle = devfs_dir_findent_locked(dir); if (dle != NULL) { dle->refcnt++; mtx_unlock(&dirlist_mtx); + free(dle_new->dir, M_DEVFS4); + free(dle_new, M_DEVFS4); return; } - - dle_new = malloc(sizeof(*dle), M_DEVFS4, M_WAITOK); - dle_new->dir = strdup(dir, M_DEVFS4); - dle_new->refcnt = 1; - LIST_INSERT_HEAD(&devfs_dirlist, dle_new, link); mtx_unlock(&dirlist_mtx); }