Todd Foggoa | 619ac1c | 2016-04-12 14:33:55 -0400 | [diff] [blame] | 1 | From a1020e16640e3b5d8cf32ef7d2914b788a1e06f6 Mon Sep 17 00:00:00 2001 |
| 2 | From: Bud Grise <griseb@cisco.com> |
| 3 | Date: Tue, 2 Feb 2016 12:45:44 -0800 |
| 4 | Subject: [PATCH 7/8] Fix a crash in igb_uio driver when the device is removed. |
| 5 | |
| 6 | This crash happens because the device still has MSI configured, |
| 7 | the fix is to free the IRQ. |
| 8 | |
| 9 | Signed-off-by: Todd Foggoa (tfoggoa) <tfoggoa@cisco.com> |
| 10 | --- |
| 11 | lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 7 +++++++ |
| 12 | 1 file changed, 7 insertions(+) |
| 13 | |
| 14 | diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c |
| 15 | index 72b2692..bf12391 100644 |
| 16 | --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c |
| 17 | +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c |
| 18 | @@ -506,8 +506,15 @@ static void |
| 19 | igbuio_pci_remove(struct pci_dev *dev) |
| 20 | { |
| 21 | struct rte_uio_pci_dev *udev = pci_get_drvdata(dev); |
| 22 | + struct uio_info *info = pci_get_drvdata(dev); |
| 23 | |
| 24 | sysfs_remove_group(&dev->dev.kobj, &dev_attr_grp); |
| 25 | + |
| 26 | + if (info->irq && (info->irq != UIO_IRQ_CUSTOM)){ |
| 27 | + free_irq(info->irq, info->uio_dev); |
| 28 | + info->irq = UIO_IRQ_NONE; |
| 29 | + } |
| 30 | + |
| 31 | uio_unregister_device(&udev->info); |
| 32 | igbuio_pci_release_iomem(&udev->info); |
| 33 | if (udev->mode == RTE_INTR_MODE_MSIX) |
| 34 | -- |
| 35 | 2.5.4 (Apple Git-61) |
| 36 | |