svn commit: r329957 - stable/11/sys/compat/linuxkpi/common/include/linux
Hans Petter Selasky
hselasky at FreeBSD.org
Sun Feb 25 10:22:28 UTC 2018
Author: hselasky
Date: Sun Feb 25 10:22:27 2018
New Revision: 329957
URL: https://svnweb.freebsd.org/changeset/base/329957
Log:
MFC r329464:
Add checks for valid IRQ tag before setting up or tearing down an interrupt
handler in the LinuxKPI. This is needed when the interrupt handler is disabled
before freeing the interrupt.
Submitted by: Johannes Lundberg <johalun0 at gmail.com>
Sponsored by: Mellanox Technologies
Modified:
stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:21:31 2018 (r329956)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:22:27 2018 (r329957)
@@ -121,7 +121,7 @@ enable_irq(unsigned int irq)
if (dev == NULL)
return -EINVAL;
irqe = linux_irq_ent(dev, irq);
- if (irqe == NULL)
+ if (irqe == NULL || irqe->tag != NULL)
return -EINVAL;
return -bus_setup_intr(dev->bsddev, irqe->res, INTR_TYPE_NET | INTR_MPSAFE,
NULL, linux_irq_handler, irqe, &irqe->tag);
@@ -139,7 +139,8 @@ disable_irq(unsigned int irq)
irqe = linux_irq_ent(dev, irq);
if (irqe == NULL)
return;
- bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag);
+ if (irqe->tag != NULL)
+ bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag);
irqe->tag = NULL;
}
@@ -174,7 +175,8 @@ free_irq(unsigned int irq, void *device)
irqe = linux_irq_ent(dev, irq);
if (irqe == NULL)
return;
- bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag);
+ if (irqe->tag != NULL)
+ bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag);
bus_release_resource(dev->bsddev, SYS_RES_IRQ, rid, irqe->res);
list_del(&irqe->links);
kfree(irqe);
More information about the svn-src-stable
mailing list