Re: [PATCH 5/6] LoongArch: KVM: Propagate real error code in kvm_pch_pic_create

From: Bibo Mao

Date: Mon Sep 28 2026 - 03:27:11 EST




On 2026/9/27 下午3:52, Tao Cui wrote:
From: Tao Cui <cuitao@xxxxxxxxxx>

kvm_pch_pic_create() replaces the real error of
kvm_setup_default_irq_routing() with a fixed -ENOMEM. Return the
actual code, as kvm_eiointc_create() already does; the kvm_ipi_create()
case is fixed separately by "Return the actual error code in
kvm_ipi_create()" (Chaithanya Lagisetty).

Fixes: 1928254c5ccb ("LoongArch: KVM: Add irqfd support")
Signed-off-by: Tao Cui <cuitao@xxxxxxxxxx>
---
arch/loongarch/kvm/intc/pch_pic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/loongarch/kvm/intc/pch_pic.c b/arch/loongarch/kvm/intc/pch_pic.c
index e33d6693c37c..136211f154d4 100644
--- a/arch/loongarch/kvm/intc/pch_pic.c
+++ b/arch/loongarch/kvm/intc/pch_pic.c
@@ -448,7 +448,7 @@ static int kvm_pch_pic_create(struct kvm_device *dev, u32 type)
ret = kvm_setup_default_irq_routing(kvm);
if (ret)
- return -ENOMEM;
+ return ret;
s = kzalloc_obj(struct loongarch_pch_pic);
if (!s)

Reviewed-by: Bibo Mao <maobibo@xxxxxxxxxxx>