Commit dd7078f0 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by David S. Miller

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: 19971f5e ("enetc: add PTP clock driver")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dd1bf47a
...@@ -82,7 +82,7 @@ static int enetc_ptp_probe(struct pci_dev *pdev, ...@@ -82,7 +82,7 @@ static int enetc_ptp_probe(struct pci_dev *pdev,
n = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSIX); n = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSIX);
if (n != 1) { if (n != 1) {
err = -EPERM; err = -EPERM;
goto err_irq; goto err_irq_vectors;
} }
ptp_qoriq->irq = pci_irq_vector(pdev, 0); ptp_qoriq->irq = pci_irq_vector(pdev, 0);
...@@ -107,6 +107,8 @@ static int enetc_ptp_probe(struct pci_dev *pdev, ...@@ -107,6 +107,8 @@ static int enetc_ptp_probe(struct pci_dev *pdev,
err_no_clock: err_no_clock:
free_irq(ptp_qoriq->irq, ptp_qoriq); free_irq(ptp_qoriq->irq, ptp_qoriq);
err_irq: err_irq:
pci_free_irq_vectors(pdev);
err_irq_vectors:
iounmap(base); iounmap(base);
err_ioremap: err_ioremap:
kfree(ptp_qoriq); kfree(ptp_qoriq);
...@@ -125,6 +127,7 @@ static void enetc_ptp_remove(struct pci_dev *pdev) ...@@ -125,6 +127,7 @@ static void enetc_ptp_remove(struct pci_dev *pdev)
enetc_phc_index = -1; enetc_phc_index = -1;
ptp_qoriq_free(ptp_qoriq); ptp_qoriq_free(ptp_qoriq);
pci_free_irq_vectors(pdev);
kfree(ptp_qoriq); kfree(ptp_qoriq);
pci_release_mem_regions(pdev); pci_release_mem_regions(pdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment