From 72e79354316939a5d90102f293cd8b739797ded0 Mon Sep 17 00:00:00 2001 From: yezhonghui Date: Wed, 16 Oct 2024 13:15:46 +0800 Subject: [PATCH] Fix disable msi when msi capability not exist issue Signed-off-by: yezhonghui --- drivers/pci/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 7752c1bd46..beb5550ccf 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1944,7 +1944,10 @@ int pci_connect_irq(FAR struct pci_device_s *dev, FAR int *irq, int num) { /* Disalbe MSI */ - pci_disable_msi(dev, msi); + if (msi != 0) + { + pci_disable_msi(dev, msi); + } /* Enable MSI-X */