]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: debugfs: fix memory leak in kvm_create_vm_debugfs
authorPavel Skripkin <paskripkin@gmail.com>
Thu, 1 Jul 2021 19:55:00 +0000 (22:55 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 15 Jul 2021 14:19:40 +0000 (10:19 -0400)
commit775d7226a630fd9586fe26b289aa6a0e3c4a6a85
tree9c2d08dc7ed7666f7bc01b51623b03b6801d7d1d
parent64e945461f6e795710c5f0ee4b59fe5fbdd3af0a
kvm: debugfs: fix memory leak in kvm_create_vm_debugfs

In commit 19504b2069e0 ("KVM: debugfs: Reuse binary stats descriptors")
loop for filling debugfs_stat_data was copy-pasted 2 times, but
in the second loop pointers are saved over pointers allocated
in the first loop.  All this causes is a memory leak, fix it.

Fixes: 19504b2069e0 ("KVM: debugfs: Reuse binary stats descriptors")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Reviewed-by: Jing Zhang <jingzhangos@google.com>
Message-Id: <20210701195500.27097-1-paskripkin@gmail.com>
Reviewed-by: Jing Zhang <jingzhangos@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c