blob: 07e1c9c81405ec9cf7dcbfa8d7f8dbf7bbb91915 [file] [log] [blame]
Ray Kinsella2bd44b72016-08-10 12:48:06 +01001From 95c2d549d8d123aac37a372580122f1b043c6165 Mon Sep 17 00:00:00 2001
2From: Ray Kinsella <ray.kinsella@intel.com>
3Date: Wed, 10 Aug 2016 11:59:07 +0100
4Subject: [PATCH] UIO: Fix a crash in igb_uio driver when the device is
5 removed.
6
7This crash happens because the device still has MSI configured,
8the fix is to free the IRQ.
9
10Signed-off-by: Todd Foggoa (tfoggoa) <tfoggoa@cisco.com>
11Signed-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
16diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
17index 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--
371.9.1
38