summaryrefslogtreecommitdiff
path: root/sys/dev/pv
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pv')
-rw-r--r--sys/dev/pv/hypervic.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/pv/hypervic.c b/sys/dev/pv/hypervic.c
index ef96dce7f44..ad5fc9b0c0b 100644
--- a/sys/dev/pv/hypervic.c
+++ b/sys/dev/pv/hypervic.c
@@ -759,14 +759,21 @@ kvp_pool_keys(struct kvp_pool *kvpl, int next, char *key, size_t *keylen)
struct kvp_entry *kpe;
int iter = 0;
+ mtx_enter(&kvpl->kvp_lock);
+
TAILQ_FOREACH(kpe, &kvpl->kvp_entries, kpe_entry) {
if (iter++ < next)
continue;
*keylen = strlen(kpe->kpe_key) + 1;
strlcpy(key, kpe->kpe_key, *keylen);
+
+ mtx_leave(&kvpl->kvp_lock);
+
return (0);
}
+ mtx_leave(&kvpl->kvp_lock);
+
return (-1);
}