[PATCH v2 3/4] LoongArch: KVM: Propagate real error code in kvm_pch_pic_create

From: Tao Cui

Date: Tue Sep 29 2026 - 06:35:16 EST


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: e785dfacf7e7 ("LoongArch: KVM: Add PCHPIC device support")
Signed-off-by: Tao Cui <cuitao@xxxxxxxxxx>
Reviewed-by: Bibo Mao <maobibo@xxxxxxxxxxx>
---
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 30a8c65c7609..7a704f18880d 100644
--- a/arch/loongarch/kvm/intc/pch_pic.c
+++ b/arch/loongarch/kvm/intc/pch_pic.c
@@ -445,7 +445,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)
--
2.43.0