summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorVishnu Dasa <vdasa@vmware.com>2022-03-17 22:58:43 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-03-18 13:47:34 +0100
commit5df0e734b8c39598effe0f17e5bd8ff7748a0693 (patch)
tree2c26482b6b5c5487dd49038c84bc5676211b79b9 /drivers/misc
parente70bcbcfa983580109c5daa2391ecb9d07dc7cfd (diff)
downloadlinux-5df0e734b8c39598effe0f17e5bd8ff7748a0693.tar.bz2
VMCI: Check exclusive_vectors when freeing interrupt 1
free_irq() may be called to free an interrupt that was not allocated. Add missing 'if' statement to check for exclusive_vectors when freeing interrupt 1. Fixes: cc68f2177fcb ("VMCI: dma dg: register dummy IRQ handlers for DMA datagrams") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Bryan Tan <bryantan@vmware.com> Reviewed-by: Rajesh Jalisatgi <rjalisatgi@vmware.com> Signed-off-by: Vishnu Dasa <vdasa@vmware.com> Link: https://lore.kernel.org/r/20220318055843.30606-1-vdasa@vmware.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/vmw_vmci/vmci_guest.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/misc/vmw_vmci/vmci_guest.c b/drivers/misc/vmw_vmci/vmci_guest.c
index 981b19308e6f..c8181467d4c5 100644
--- a/drivers/misc/vmw_vmci/vmci_guest.c
+++ b/drivers/misc/vmw_vmci/vmci_guest.c
@@ -862,7 +862,9 @@ static int vmci_guest_probe_device(struct pci_dev *pdev,
return 0;
err_free_bm_irq:
- free_irq(pci_irq_vector(pdev, 1), vmci_dev);
+ if (vmci_dev->exclusive_vectors)
+ free_irq(pci_irq_vector(pdev, 1), vmci_dev);
+
err_free_irq:
free_irq(pci_irq_vector(pdev, 0), vmci_dev);
tasklet_kill(&vmci_dev->datagram_tasklet);