Date: Thu, 30 Nov 2017 14:06:54 +0000 (UTC) From: Emmanuel Vadot <manu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326395 - head/sys/fs/devfs Message-ID: <201711301406.vAUE6sWi029222@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711301406.vAUE6sWi029222>