diff options
Diffstat (limited to 'virt/kvm/eventfd.c')
-rw-r--r-- | virt/kvm/eventfd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index 315a586ec4d5..486c604365d9 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c | |||
@@ -508,7 +508,7 @@ kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | |||
508 | else | 508 | else |
509 | p->wildcard = true; | 509 | p->wildcard = true; |
510 | 510 | ||
511 | down_write(&kvm->slots_lock); | 511 | mutex_lock(&kvm->slots_lock); |
512 | 512 | ||
513 | /* Verify that there isnt a match already */ | 513 | /* Verify that there isnt a match already */ |
514 | if (ioeventfd_check_collision(kvm, p)) { | 514 | if (ioeventfd_check_collision(kvm, p)) { |
@@ -524,12 +524,12 @@ kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | |||
524 | 524 | ||
525 | list_add_tail(&p->list, &kvm->ioeventfds); | 525 | list_add_tail(&p->list, &kvm->ioeventfds); |
526 | 526 | ||
527 | up_write(&kvm->slots_lock); | 527 | mutex_unlock(&kvm->slots_lock); |
528 | 528 | ||
529 | return 0; | 529 | return 0; |
530 | 530 | ||
531 | unlock_fail: | 531 | unlock_fail: |
532 | up_write(&kvm->slots_lock); | 532 | mutex_unlock(&kvm->slots_lock); |
533 | 533 | ||
534 | fail: | 534 | fail: |
535 | kfree(p); | 535 | kfree(p); |
@@ -551,7 +551,7 @@ kvm_deassign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | |||
551 | if (IS_ERR(eventfd)) | 551 | if (IS_ERR(eventfd)) |
552 | return PTR_ERR(eventfd); | 552 | return PTR_ERR(eventfd); |
553 | 553 | ||
554 | down_write(&kvm->slots_lock); | 554 | mutex_lock(&kvm->slots_lock); |
555 | 555 | ||
556 | list_for_each_entry_safe(p, tmp, &kvm->ioeventfds, list) { | 556 | list_for_each_entry_safe(p, tmp, &kvm->ioeventfds, list) { |
557 | bool wildcard = !(args->flags & KVM_IOEVENTFD_FLAG_DATAMATCH); | 557 | bool wildcard = !(args->flags & KVM_IOEVENTFD_FLAG_DATAMATCH); |
@@ -571,7 +571,7 @@ kvm_deassign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | |||
571 | break; | 571 | break; |
572 | } | 572 | } |
573 | 573 | ||
574 | up_write(&kvm->slots_lock); | 574 | mutex_unlock(&kvm->slots_lock); |
575 | 575 | ||
576 | eventfd_ctx_put(eventfd); | 576 | eventfd_ctx_put(eventfd); |
577 | 577 | ||