]> Pileus Git - ~andy/linux/commitdiff
KVM: use a more sensible error number when debugfs directory creation fails
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 30 Oct 2013 11:12:13 +0000 (12:12 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 30 Oct 2013 11:15:34 +0000 (12:15 +0100)
I don't know if this was due to cut and paste, or somebody was really
using a D20 to pick the error code for kvm_init_debugfs as suggested by
Linus (EFAULT is 14, so the possibility cannot be entirely ruled out).

In any case, this patch fixes it.

Reported-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c

index a9dd682cf5e3f5117de017156396337a8352914f..1cf9ccb010131d42c3a573079437d87502ac016f 100644 (file)
@@ -3091,7 +3091,7 @@ static const struct file_operations *stat_fops[] = {
 
 static int kvm_init_debug(void)
 {
-       int r = -EFAULT;
+       int r = -EEXIST;
        struct kvm_stats_debugfs_item *p;
 
        kvm_debugfs_dir = debugfs_create_dir("kvm", NULL);