Ray Kinsella | 2bd44b7 | 2016-08-10 12:48:06 +0100 | [diff] [blame] | 1 | From 95c2d549d8d123aac37a372580122f1b043c6165 Mon Sep 17 00:00:00 2001 |
| 2 | From: Ray Kinsella <ray.kinsella@intel.com> |
| 3 | Date: Wed, 10 Aug 2016 11:59:07 +0100 |
| 4 | Subject: [PATCH] UIO: Fix a crash in igb_uio driver when the device is |
| 5 | removed. |
| 6 | |
| 7 | This crash happens because the device still has MSI configured, |
| 8 | the fix is to free the IRQ. |
| 9 | |
| 10 | Signed-off-by: Todd Foggoa (tfoggoa) <tfoggoa@cisco.com> |
| 11 | Signed-off-by: Ray Kinsella <ray.kinsella@intel.com> |
| 12 | --- |
| 13 | lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 7 +++++++ |
| 14 | 1 file changed, 7 insertions(+) |
| 15 | |
| 16 | diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c |
| 17 | index df41e45..69873e7 100644 |
| 18 | --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c |
| 19 | +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c |
| 20 | @@ -442,8 +442,15 @@ static void |
| 21 | igbuio_pci_remove(struct pci_dev *dev) |
| 22 | { |
| 23 | struct rte_uio_pci_dev *udev = pci_get_drvdata(dev); |
| 24 | + struct uio_info *info = pci_get_drvdata(dev); |
| 25 | |
| 26 | sysfs_remove_group(&dev->dev.kobj, &dev_attr_grp); |
| 27 | + |
| 28 | + if (info->irq && (info->irq != UIO_IRQ_CUSTOM)){ |
| 29 | + free_irq(info->irq, info->uio_dev); |
| 30 | + info->irq = UIO_IRQ_NONE; |
| 31 | + } |
| 32 | + |
| 33 | uio_unregister_device(&udev->info); |
| 34 | igbuio_pci_release_iomem(&udev->info); |
| 35 | if (udev->mode == RTE_INTR_MODE_MSIX) |
| 36 | -- |
| 37 | 1.9.1 |
| 38 | |