diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-02-23 10:06:40 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-02-23 10:06:40 +0000 |
commit | e1a22e30244b366f8b09634b75127d1d59faf33e (patch) | |
tree | 94bff387d9b163ae3be0bd1ace1fe1a3857bca10 | |
parent | a469f6e2fd62221174b629264e1d1ba3c696dc42 (diff) |
Add missing mtx_leave() calls in two hypervic error paths
ok mikeb@
-rw-r--r-- | sys/dev/pv/hypervic.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/pv/hypervic.c b/sys/dev/pv/hypervic.c index d5d233b700b..1ed7c3d07a2 100644 --- a/sys/dev/pv/hypervic.c +++ b/sys/dev/pv/hypervic.c @@ -571,8 +571,10 @@ kvp_pool_insert(struct kvp_pool *kvpl, const char *key, const char *val, } kpe = pool_get(&kvp_entry_pool, PR_ZERO | PR_NOWAIT); - if (kpe == NULL) + if (kpe == NULL) { + mtx_leave(&kvpl->kvp_lock); return (ENOMEM); + } strlcpy(kpe->kpe_key, key, HV_KVP_MAX_KEY_SIZE / 2); @@ -639,8 +641,10 @@ kvp_pool_import(struct kvp_pool *kvpl, const char *key, uint32_t keylen, } if (kpe == NULL) { kpe = pool_get(&kvp_entry_pool, PR_ZERO | PR_NOWAIT); - if (kpe == NULL) + if (kpe == NULL) { + mtx_leave(&kvpl->kvp_lock); return (ENOMEM); + } copyin_utf16le(kpe->kpe_key, key, HV_KVP_MAX_KEY_SIZE / 2, keylen); |