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>
Šī revīzija ir iekļauta:

revīziju iesūtīja
Christian Borntraeger

vecāks
8d6037a7b4
revīzija
154c8c19c3
@@ -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);
|
||||
|
||||
|
Atsaukties uz šo jaunā problēmā
Block a user