2022-03-18 08:30:03

by Vishnu Dasa

[permalink] [raw]
Subject: [PATCH RESEND] VMCI: Check exclusive_vectors when freeing interrupt 1

From: Vishnu Dasa <[email protected]>

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 <[email protected]>
Reviewed-by: Bryan Tan <[email protected]>
Reviewed-by: Rajesh Jalisatgi <[email protected]>
Signed-off-by: Vishnu Dasa <[email protected]>
---
drivers/misc/vmw_vmci/vmci_guest.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/vmw_vmci/vmci_guest.c b/drivers/misc/vmw_vmci/vmci_guest.c
index 6596a54daa88..57a6157209a1 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);
--
2.25.1


2022-03-18 17:22:39

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH RESEND] VMCI: Check exclusive_vectors when freeing interrupt 1

On Thu, Mar 17, 2022 at 10:58:43PM -0700, [email protected] wrote:
> From: Vishnu Dasa <[email protected]>
>
> 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 <[email protected]>
> Reviewed-by: Bryan Tan <[email protected]>
> Reviewed-by: Rajesh Jalisatgi <[email protected]>
> Signed-off-by: Vishnu Dasa <[email protected]>
> ---
> drivers/misc/vmw_vmci/vmci_guest.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/misc/vmw_vmci/vmci_guest.c b/drivers/misc/vmw_vmci/vmci_guest.c
> index 6596a54daa88..57a6157209a1 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);
> --
> 2.25.1
>

You sent the previous version 2 days before this, and 5 days before
that. Please relax and don't start worrying unless it's been 2 weeks.

thanks,

greg k-h