]> git.ipfire.org Git - thirdparty/linux.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)
committerHuacai Chen <chenhuacai@loongson.cn>
Sat, 17 Jan 2026 02:57:03 +0000 (10:57 +0800)
commit1cf342a7c3adc5877837b53bbceb5cc9eff60bbf
treea9c50558f8bf158439f33a95dc71e00cdf393756
parent7d8553fc75aefa7ec936af0cf8443ff90b51732e
LoongArch: KVM: Fix kvm_device leak in kvm_pch_pic_destroy()

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>
arch/loongarch/kvm/intc/pch_pic.c