diff options
author | David Hildenbrand <dahi@linux.vnet.ibm.com> | 2016-05-09 11:22:34 +0200 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2016-06-10 12:07:28 +0200 |
commit | 154c8c19c35b6da94a623cb793458e203572083d (patch) | |
tree | 9ca37ad9fa34d1495bb1c770b035192c87a15854 /arch/s390/kvm/kvm-s390.c | |
parent | 8d6037a7b4f21708451d4aec14828f9ebe77b37a (diff) | |
download | linux-154c8c19c35b6da94a623cb793458e203572083d.tar.gz linux-154c8c19c35b6da94a623cb793458e203572083d.tar.bz2 linux-154c8c19c35b6da94a623cb793458e203572083d.zip |
s390/mm: return key via pointer in get_guest_storage_key
Let's just split returning the key and reporting errors. This makes calling
code easier and avoids bugs as happened already.
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm/kvm-s390.c')
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index d0156d7969e0..ad166c6698e0 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -1029,7 +1029,6 @@ static long kvm_s390_get_skeys(struct kvm *kvm, struct kvm_s390_skeys *args) { uint8_t *keys; uint64_t hva; - unsigned long curkey; int i, r = 0; if (args->flags != 0) @@ -1058,12 +1057,9 @@ static long kvm_s390_get_skeys(struct kvm *kvm, struct kvm_s390_skeys *args) break; } - curkey = get_guest_storage_key(current->mm, hva); - if (IS_ERR_VALUE(curkey)) { - r = curkey; + r = get_guest_storage_key(current->mm, hva, &keys[i]); + if (r) break; - } - keys[i] = curkey; } up_read(¤t->mm->mmap_sem); |