Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1473712 > unrolled thread

[PATCH 1/4] kvm: kvm_destroy_vm_debugfs(): check debugs_stat_data pointer

Started byLuiz Capitulino <lcapitulino@redhat.com>
First post2016-08-31 19:10 +0200
Last post2016-09-02 16:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/4] kvm: kvm_destroy_vm_debugfs(): check debugs_stat_data pointer Luiz Capitulino <lcapitulino@redhat.com> - 2016-08-31 19:10 +0200
    Re: [PATCH 1/4] kvm: kvm_destroy_vm_debugfs(): check debugs_stat_data  pointer Paolo Bonzini <pbonzini@redhat.com> - 2016-09-02 16:00 +0200

#1473712 — [PATCH 1/4] kvm: kvm_destroy_vm_debugfs(): check debugs_stat_data pointer

FromLuiz Capitulino <lcapitulino@redhat.com>
Date2016-08-31 19:10 +0200
Subject[PATCH 1/4] kvm: kvm_destroy_vm_debugfs(): check debugs_stat_data pointer
Message-ID<schbr-59T-3@gated-at.bofh.it>
This make it possible to call kvm_destroy_vm_debugfs() from
kvm_create_vm_debugfs() in error conditions.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 virt/kvm/kvm_main.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 1950782..c1dc45e 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -559,9 +559,11 @@ static void kvm_destroy_vm_debugfs(struct kvm *kvm)
 
 	debugfs_remove_recursive(kvm->debugfs_dentry);
 
-	for (i = 0; i < kvm_debugfs_num_entries; i++)
-		kfree(kvm->debugfs_stat_data[i]);
-	kfree(kvm->debugfs_stat_data);
+	if (kvm->debugfs_stat_data) {
+		for (i = 0; i < kvm_debugfs_num_entries; i++)
+			kfree(kvm->debugfs_stat_data[i]);
+		kfree(kvm->debugfs_stat_data);
+	}
 }
 
 static int kvm_create_vm_debugfs(struct kvm *kvm, int fd)
-- 
2.5.5

[toc] | [next] | [standalone]


#1475159 — Re: [PATCH 1/4] kvm: kvm_destroy_vm_debugfs(): check debugs_stat_data pointer

FromPaolo Bonzini <pbonzini@redhat.com>
Date2016-09-02 16:00 +0200
SubjectRe: [PATCH 1/4] kvm: kvm_destroy_vm_debugfs(): check debugs_stat_data pointer
Message-ID<scXaF-9t-1@gated-at.bofh.it>
In reply to#1473712

On 31/08/2016 19:05, Luiz Capitulino wrote:
> This make it possible to call kvm_destroy_vm_debugfs() from
> kvm_create_vm_debugfs() in error conditions.
> 
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
>  virt/kvm/kvm_main.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 1950782..c1dc45e 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -559,9 +559,11 @@ static void kvm_destroy_vm_debugfs(struct kvm *kvm)
>  
>  	debugfs_remove_recursive(kvm->debugfs_dentry);
>  
> -	for (i = 0; i < kvm_debugfs_num_entries; i++)
> -		kfree(kvm->debugfs_stat_data[i]);
> -	kfree(kvm->debugfs_stat_data);
> +	if (kvm->debugfs_stat_data) {
> +		for (i = 0; i < kvm_debugfs_num_entries; i++)
> +			kfree(kvm->debugfs_stat_data[i]);
> +		kfree(kvm->debugfs_stat_data);
> +	}
>  }
>  
>  static int kvm_create_vm_debugfs(struct kvm *kvm, int fd)
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web