Commit a6f8e68e authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Herbert Xu

crypto: ccp - Fix a resource leak in an error handling path

If an error occurs after calling 'sp_get_irqs()', 'sp_free_irqs()' must be
called as already done in the error handling path.

Fixes: f4d18d65 ("crypto: ccp - Abstract interrupt registeration")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: default avatarJohn Allen <john.allen@amd.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent b7da13d0
...@@ -222,7 +222,7 @@ static int sp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -222,7 +222,7 @@ static int sp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
if (ret) { if (ret) {
dev_err(dev, "dma_set_mask_and_coherent failed (%d)\n", dev_err(dev, "dma_set_mask_and_coherent failed (%d)\n",
ret); ret);
goto e_err; goto free_irqs;
} }
} }
...@@ -230,10 +230,12 @@ static int sp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -230,10 +230,12 @@ static int sp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
ret = sp_init(sp); ret = sp_init(sp);
if (ret) if (ret)
goto e_err; goto free_irqs;
return 0; return 0;
free_irqs:
sp_free_irqs(sp);
e_err: e_err:
dev_notice(dev, "initialization failed\n"); dev_notice(dev, "initialization failed\n");
return ret; return ret;
......
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