diff options
-rw-r--r-- | arch/powerpc/kvm/book3s_hv.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 8b3c470e6cb9..812764c96229 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c | |||
@@ -811,9 +811,8 @@ int kvmppc_set_one_reg(struct kvm_vcpu *vcpu, u64 id, union kvmppc_one_reg *val) | |||
811 | addr = val->vpaval.addr; | 811 | addr = val->vpaval.addr; |
812 | len = val->vpaval.length; | 812 | len = val->vpaval.length; |
813 | r = -EINVAL; | 813 | r = -EINVAL; |
814 | if (len < sizeof(struct dtl_entry)) | 814 | if (addr && (len < sizeof(struct dtl_entry) || |
815 | break; | 815 | !vcpu->arch.vpa.next_gpa)) |
816 | if (addr && !vcpu->arch.vpa.next_gpa) | ||
817 | break; | 816 | break; |
818 | len -= len % sizeof(struct dtl_entry); | 817 | len -= len % sizeof(struct dtl_entry); |
819 | r = set_vpa(vcpu, &vcpu->arch.dtl, addr, len); | 818 | r = set_vpa(vcpu, &vcpu->arch.dtl, addr, len); |