aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2019-08-30 16:23:12 -0400
committerDavid S. Miller <davem@davemloft.net>2019-09-01 02:53:17 -0400
commitdd7078f05e1b774a9e8c9f117101d97e4ccd0691 (patch)
treed57d4f700f1a3119674455536beffc11dcf5076c
parentdd1bf47a84fe64edf50f6a83fdc164d0da6fa021 (diff)
enetc: Add missing call to 'pci_free_irq_vectors()' in probe and remove functions
Call to 'pci_free_irq_vectors()' are missing both in the error handling path of the probe function, and in the remove function. Add them. Fixes: 19971f5ea0ab ("enetc: add PTP clock driver") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/freescale/enetc/enetc_ptp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
index 2fd2586e42bf..bc594892507a 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
@@ -82,7 +82,7 @@ static int enetc_ptp_probe(struct pci_dev *pdev,
82 n = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSIX); 82 n = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSIX);
83 if (n != 1) { 83 if (n != 1) {
84 err = -EPERM; 84 err = -EPERM;
85 goto err_irq; 85 goto err_irq_vectors;
86 } 86 }
87 87
88 ptp_qoriq->irq = pci_irq_vector(pdev, 0); 88 ptp_qoriq->irq = pci_irq_vector(pdev, 0);
@@ -107,6 +107,8 @@ static int enetc_ptp_probe(struct pci_dev *pdev,
107err_no_clock: 107err_no_clock:
108 free_irq(ptp_qoriq->irq, ptp_qoriq); 108 free_irq(ptp_qoriq->irq, ptp_qoriq);
109err_irq: 109err_irq:
110 pci_free_irq_vectors(pdev);
111err_irq_vectors:
110 iounmap(base); 112 iounmap(base);
111err_ioremap: 113err_ioremap:
112 kfree(ptp_qoriq); 114 kfree(ptp_qoriq);
@@ -125,6 +127,7 @@ static void enetc_ptp_remove(struct pci_dev *pdev)
125 127
126 enetc_phc_index = -1; 128 enetc_phc_index = -1;
127 ptp_qoriq_free(ptp_qoriq); 129 ptp_qoriq_free(ptp_qoriq);
130 pci_free_irq_vectors(pdev);
128 kfree(ptp_qoriq); 131 kfree(ptp_qoriq);
129 132
130 pci_release_mem_regions(pdev); 133 pci_release_mem_regions(pdev);