diff options
| author | John Levon <john.levon@joyent.com> | 2019-11-05 17:47:46 +0000 |
|---|---|---|
| committer | John Levon <john.levon@joyent.com> | 2019-11-07 11:33:27 +0000 |
| commit | 249622b3e0d46f0016d00e3f87b314635d11065a (patch) | |
| tree | a693bd5d42488e5a83afa118ac7266a95f5a543a | |
| parent | 4c05824a49c53dcd087c0babf8780068997f0735 (diff) | |
| download | illumos-joyent-249622b3e0d46f0016d00e3f87b314635d11065a.tar.gz | |
11929 mac_minor_hold() gets id_alloc_nosleep() wrong
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Dan McDonald <danmcd@joyent.com>
| -rw-r--r-- | usr/src/uts/common/io/mac/mac.c | 12 |
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); } /* |
