]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
LoongArch: KVM: Fix kvm_device leak in kvm_pch_pic_destroy()
authorQiang Ma <maqianga@uniontech.com>
Sat, 17 Jan 2026 02:57:03 +0000 (10:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Jan 2026 10:21:32 +0000 (11:21 +0100)
commitfc53a66227af08d868face4b33fa8b2e1ba187ed
treee7e0c71d629f4d0e92c14bbde2066525d068eb63
parent5defcc2f9c22e6e09b5be68234ad10f4ba0292b7
LoongArch: KVM: Fix kvm_device leak in kvm_pch_pic_destroy()

commit 1cf342a7c3adc5877837b53bbceb5cc9eff60bbf upstream.

In kvm_ioctl_create_device(), kvm_device has allocated memory,
kvm_device->destroy() seems to be supposed to free its kvm_device
struct, but kvm_pch_pic_destroy() is not currently doing this, that
would lead to a memory leak.

So, fix it.

Cc: stable@vger.kernel.org
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Qiang Ma <maqianga@uniontech.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/loongarch/kvm/intc/pch_pic.c