From 44c46036175a86eb9a0675fe3e14986e71f240d5 Mon Sep 17 00:00:00 2001 From: Venkatesh Srinivas Date: Wed, 25 Aug 2010 07:53:31 -0700 Subject: [PATCH] MPSAFE: MPSAFE kern/kern_uuid,c kern_uuid already protected itself with a lockmgr lock; holding the mplock was not required. --- sys/kern/kern_uuid.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_uuid.c b/sys/kern/kern_uuid.c index a4fa8e88f7..1cc1b011fa 100644 --- a/sys/kern/kern_uuid.c +++ b/sys/kern/kern_uuid.c @@ -41,8 +41,6 @@ #include #include -#include - /* * See also: * http://www.opengroup.org/dce/info/draft-leach-uuids-guids-01.txt @@ -156,8 +154,6 @@ kern_uuidgen(struct uuid *store, size_t count) * uuidgen(struct uuid *store, int count) * * Generate an array of new UUIDs - * - * MPALMOSTSAFE */ int sys_uuidgen(struct uuidgen_args *uap) @@ -176,10 +172,10 @@ sys_uuidgen(struct uuidgen_args *uap) return (EINVAL); count = uap->count; - store = kmalloc(count * sizeof(struct uuid), M_TEMP, M_WAITOK); - get_mplock(); + store = kmalloc(count * sizeof(struct uuid), M_TEMP, M_WAITOK|M_NULLOK); + if (store == NULL) + return (ENOSPC); kern_uuidgen(store, count); - rel_mplock(); error = copyout(store, uap->store, count * sizeof(struct uuid)); kfree(store, M_TEMP); return (error); -- 2.41.0