diff options
-rw-r--r-- | drivers/pci/host/pci-hyperv.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c index 7de341d7caaa..6955ffdb89f3 100644 --- a/drivers/pci/host/pci-hyperv.c +++ b/drivers/pci/host/pci-hyperv.c | |||
@@ -732,16 +732,18 @@ static void hv_msi_free(struct irq_domain *domain, struct msi_domain_info *info, | |||
732 | 732 | ||
733 | pdev = msi_desc_to_pci_dev(msi); | 733 | pdev = msi_desc_to_pci_dev(msi); |
734 | hbus = info->data; | 734 | hbus = info->data; |
735 | hpdev = get_pcichild_wslot(hbus, devfn_to_wslot(pdev->devfn)); | 735 | int_desc = irq_data_get_irq_chip_data(irq_data); |
736 | if (!hpdev) | 736 | if (!int_desc) |
737 | return; | 737 | return; |
738 | 738 | ||
739 | int_desc = irq_data_get_irq_chip_data(irq_data); | 739 | irq_data->chip_data = NULL; |
740 | if (int_desc) { | 740 | hpdev = get_pcichild_wslot(hbus, devfn_to_wslot(pdev->devfn)); |
741 | irq_data->chip_data = NULL; | 741 | if (!hpdev) { |
742 | hv_int_desc_free(hpdev, int_desc); | 742 | kfree(int_desc); |
743 | return; | ||
743 | } | 744 | } |
744 | 745 | ||
746 | hv_int_desc_free(hpdev, int_desc); | ||
745 | put_pcichild(hpdev, hv_pcidev_ref_by_slot); | 747 | put_pcichild(hpdev, hv_pcidev_ref_by_slot); |
746 | } | 748 | } |
747 | 749 | ||