From: Paolo Bonzini Date: Wed, 30 Oct 2013 11:12:13 +0000 (+0100) Subject: KVM: use a more sensible error number when debugfs directory creation fails X-Git-Tag: firefly_0821_release~3680^2~36^2~16^2^2~191 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e845f9d367f2ac8197a142fd29d1baa8fcc4dd75;p=firefly-linux-kernel-4.4.55.git KVM: use a more sensible error number when debugfs directory creation fails 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 Signed-off-by: Paolo Bonzini (cherry picked from commit 0c8eb04a6241da28deb108181213b791c378123b) Signed-off-by: Christoffer Dall --- diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 340c97cf55b6..d6b7d797cb16 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -3010,7 +3010,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);