From: Eric Auger Date: Mon, 4 May 2015 01:25:18 +0000 (+0800) Subject: KVM: arm/arm64: vgic: vgic_init returns -ENODEV when no online vcpu X-Git-Tag: v3.18.14~208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fca593bd1a16d81b12b4081ee0234c9b92cc06a;p=thirdparty%2Fkernel%2Fstable.git KVM: arm/arm64: vgic: vgic_init returns -ENODEV when no online vcpu commit 66b030e48af68fd4c22d343908bc057207a0a31e upstream. To be more explicit on vgic initialization failure, -ENODEV is returned by vgic_init when no online vcpus can be found at init. Signed-off-by: Eric Auger Signed-off-by: Christoffer Dall Signed-off-by: Shannon Zhao Signed-off-by: Sasha Levin --- diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 9a8c18301b7a4..fc82307fbd8ca 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -1807,7 +1807,7 @@ static int vgic_init(struct kvm *kvm) nr_cpus = dist->nr_cpus = atomic_read(&kvm->online_vcpus); if (!nr_cpus) /* No vcpus? Can't be good... */ - return -EINVAL; + return -ENODEV; /* * If nobody configured the number of interrupts, use the