diff options
-rw-r--r-- | include/linux/kvm_host.h | 1 | ||||
-rw-r--r-- | virt/kvm/kvm_main.c | 18 |
2 files changed, 4 insertions, 15 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index a754fc08e194..590c46e672df 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -1016,7 +1016,6 @@ struct kvm_stats_debugfs_item { | |||
1016 | const char *name; | 1016 | const char *name; |
1017 | int offset; | 1017 | int offset; |
1018 | enum kvm_stat_kind kind; | 1018 | enum kvm_stat_kind kind; |
1019 | struct dentry *dentry; | ||
1020 | }; | 1019 | }; |
1021 | extern struct kvm_stats_debugfs_item debugfs_entries[]; | 1020 | extern struct kvm_stats_debugfs_item debugfs_entries[]; |
1022 | extern struct dentry *kvm_debugfs_dir; | 1021 | extern struct dentry *kvm_debugfs_dir; |
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 9649a42ee990..be3cef12706c 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -3447,10 +3447,9 @@ static int kvm_init_debug(void) | |||
3447 | goto out; | 3447 | goto out; |
3448 | 3448 | ||
3449 | for (p = debugfs_entries; p->name; ++p) { | 3449 | for (p = debugfs_entries; p->name; ++p) { |
3450 | p->dentry = debugfs_create_file(p->name, 0444, kvm_debugfs_dir, | 3450 | if (!debugfs_create_file(p->name, 0444, kvm_debugfs_dir, |
3451 | (void *)(long)p->offset, | 3451 | (void *)(long)p->offset, |
3452 | stat_fops[p->kind]); | 3452 | stat_fops[p->kind])) |
3453 | if (p->dentry == NULL) | ||
3454 | goto out_dir; | 3453 | goto out_dir; |
3455 | } | 3454 | } |
3456 | 3455 | ||
@@ -3462,15 +3461,6 @@ out: | |||
3462 | return r; | 3461 | return r; |
3463 | } | 3462 | } |
3464 | 3463 | ||
3465 | static void kvm_exit_debug(void) | ||
3466 | { | ||
3467 | struct kvm_stats_debugfs_item *p; | ||
3468 | |||
3469 | for (p = debugfs_entries; p->name; ++p) | ||
3470 | debugfs_remove(p->dentry); | ||
3471 | debugfs_remove(kvm_debugfs_dir); | ||
3472 | } | ||
3473 | |||
3474 | static int kvm_suspend(void) | 3464 | static int kvm_suspend(void) |
3475 | { | 3465 | { |
3476 | if (kvm_usage_count) | 3466 | if (kvm_usage_count) |
@@ -3628,7 +3618,7 @@ EXPORT_SYMBOL_GPL(kvm_init); | |||
3628 | 3618 | ||
3629 | void kvm_exit(void) | 3619 | void kvm_exit(void) |
3630 | { | 3620 | { |
3631 | kvm_exit_debug(); | 3621 | debugfs_remove_recursive(kvm_debugfs_dir); |
3632 | misc_deregister(&kvm_dev); | 3622 | misc_deregister(&kvm_dev); |
3633 | kmem_cache_destroy(kvm_vcpu_cache); | 3623 | kmem_cache_destroy(kvm_vcpu_cache); |
3634 | kvm_async_pf_deinit(); | 3624 | kvm_async_pf_deinit(); |