summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/io/mac/mac.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/usr/src/uts/common/io/mac/mac.c b/usr/src/uts/common/io/mac/mac.c
index cff19a9f74..05a382be2f 100644
--- a/usr/src/uts/common/io/mac/mac.c
+++ b/usr/src/uts/common/io/mac/mac.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2017, Joyent, Inc.
+ * Copyright 2019 Joyent, Inc.
* Copyright 2015 Garrett D'Amore <garrett@damore.org>
*/
@@ -2287,7 +2287,7 @@ mac_client_restart(mac_client_impl_t *mcip)
minor_t
mac_minor_hold(boolean_t sleep)
{
- minor_t minor;
+ id_t id;
/*
* Grab a value from the arena.
@@ -2295,16 +2295,14 @@ mac_minor_hold(boolean_t sleep)
atomic_inc_32(&minor_count);
if (sleep)
- minor = (uint_t)id_alloc(minor_ids);
- else
- minor = (uint_t)id_alloc_nosleep(minor_ids);
+ return ((uint_t)id_alloc(minor_ids));
- if (minor == 0) {
+ if ((id = id_alloc_nosleep(minor_ids)) == -1) {
atomic_dec_32(&minor_count);
return (0);
}
- return (minor);
+ return ((uint_t)id);
}
/*